|
POST
|
Perhaps this may help with a python approach .... Export geometry to WKT using pyshp - Geographic Information Systems Stack Exchange
... View more
09-29-2017
09:16 AM
|
1
|
0
|
6112
|
|
POST
|
I sorta figured that.... there was one trick I used to some success on crowded map ... sorta like a repellent. I created a big buffer around the objects I wanted to label and added the labeling data to the buffer and set the rules for labeling to occur outside of the buffer (of course the buffer was invisible) --- the buffer was my repellent away from the map focus. That was a lot of trial and error and personally I don't know if it is worth the end results. If I have to print a map more once for a client--- Annotations is the way to go.
... View more
08-31-2017
08:27 AM
|
2
|
1
|
2229
|
|
POST
|
You are showing two different scales above --- one where the problem is occurring and a much larger scale giving more room for placement. I produce as a report sign maps and have similar issues. Some tips I can give is to: Use maplex Tweak and design labels at a set scale that you wish to print at (This gives you your placement options vs label sizes) Font size Symbol Size Offsets Abbreviations Placement options around the polygon For me on my sign maps -- It was so crowded at the print scale ultimately I had you go the annotations. However I do use the above tips to place the labels prior to converting to annotations so that most of the labels are OK as is and only have to hand place a few (or fewer).....
... View more
08-30-2017
07:45 AM
|
4
|
3
|
3069
|
|
POST
|
This is a loaded question.... Since I learned to program (self taught), it was with VB. I find VB more readable than C# and can debug code much more quickly. Others may say the opposite, guess it depends upon what you are more familiar with. Personally, I write almost everything in VB, however if I have a speed critical process, or creating a specific web service/handler I use C#. As far as functions found in C# and VB --- there has been absolutely nothing I could do in either language. (pertaining to GIS) However, in working within the system and having to interface with old structural engineering programs that run in DOS and old fortran.... VB can be quite challenging, whereas C# a bit easier. VB.Net has caught up in speed and screen rendering with C# significantly over the years. Personally, I would stick with what you are comfortable with, and learn the "Other" side as you go. Translating code between them has improved significantly over the years. my 2 cents!
... View more
08-28-2017
09:24 AM
|
0
|
1
|
2873
|
|
POST
|
If you are using SQL Server then there is no other way....... Other database Oracle, postGIS .... can use ST_Geometry which will accept a polygon as you wish to send it. https://community.esri.com/thread/186602-sde-with-sql-server
... View more
08-17-2017
12:06 PM
|
0
|
1
|
4627
|
|
POST
|
Given what you told and you are not using SDE (how your are accessing sql server?), your methodology is correct. To make it less painful you could create parameter string to pass the wkt (well known text string). There are tools both in Arcgis and opensource which would convert various geometries to WKT string.. OGR2OGR one of which comes to mind. I have in the past used an opensource library called Sharpmap to convert wkt/b from/to esri compatible formats/sql server. Using this library, you could make your queries more efficient by using the well known binaries saving the overhead of converting from binary - to strings - and back again. Or you could code with arc-objects and use esri built in object to send to sql server.... for example: SqlGeometry sqlGeo = (SqlGeometry)myReader["SHAPE"]; IGeometryFactory factory = new GeometryEnvironmentClass(); IGeometry geom = new PolygonClass(); int countout; factory.CreateGeometryFromWkbVariant(sqlGeo.STAsBinary().Value, out geom, out countout);
... View more
08-17-2017
10:33 AM
|
0
|
0
|
4627
|
|
POST
|
I am assuming that you are using SQL Server to perform a spatial intersect. I have a "Bing" Map application in which a user clicks on a road. That click is turned into a point. This point is then passed through a web handler (in my case a VB ASHX file) to SQL Server. The lat and long is passed. SQL Server then creates a buffered area around that point and intersects the buffer against a Project polygon layer. The intersecting geometries and attribute data is then passed back to the web handler as a recordset stream. The geometries in my case are expressed as Well Known Text. The web handler then reads the recordset and processes the data (in my case converting the recordset into a formated string to send to my client javascript (which has no natural capacity to read a recordset). Then in javascript I parse the formated string back into psuedo records I can display on a Bing map. Although there are a lot of moving parts; this may give you some ideas to try -- SQL Server Procedure USE [GeoTest]
GO
/****** Object: StoredProcedure [dbo].[usp_ProjectQuery] Script Date: 8/17/2017 10:21:55 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Ted Kowal>
-- Create date: <7/2013>
-- Description: <Return the Projects found withing a user defined
-- radius click on the map (lat/long)>
-- =============================================
ALTER PROCEDURE [dbo].[usp_ProjectQuery]
-- Add the parameters for the stored procedure here
@latitude float,
@longitude float,
@BufferSize float
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
Declare @Point geography
SET @Point = geography::Point(@latitude,@longitude, 4326)
-- Use STBuffer() to greate a buffer around the point to BufferSize in Feet
Declare @SearchArea geometry
Declare @G geography
-- This should be done usine Geography (Have not been able to get it working using
-- Geometry)
Set @G = @Point.STBuffer(@BufferSize *.3048)
-- Convert Search Area to Geometry from Geography
Set @SearchArea = geometry::STGeomFromWKB((Select @G.STAsBinary()), 4326)
-- Select any lights that intersect the search area
Select
Distinct ProjectNumber, ProjectName,
CONCAT(ProjectDescription,' ',ProjectDesc2Part) as Description,
ProjectType,Status,CompletionDate
From
PROJECTS
Where
Shape.STIntersects(@SearchArea) = 1
END
This procedure returns the Well Known Text geometries for any Project: USE [GeoTest]
GO
/****** Object: StoredProcedure [dbo].[usp_ProjectLimit] Script Date: 8/17/2017 10:40:02 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Ted Kowal>
-- Create date: <6/2013>
-- Description: <Return the Geometry for a specific Project Limit>
-- =============================================
ALTER PROCEDURE [dbo].[usp_ProjectLimit]
-- Add the parameters for the stored procedure here
@pnumber nvarchar(50)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
Select
ObjectID,
Shape.STGeometryType() as GeometryType,
Shape.STAsText() as WKT,
'ProjectNumber: ' + ProjectNumber as Title,
concat(ProjectDescription,' ',ProjectDesc2Part) as Description
From
PROJECTS
Where
ProjectNumber = @pnumber
END Web handler ashx file <%@ WebHandler Language="VB" Class="MDXProjects" %>
Imports System
Imports System.Web
Imports System.Data.SqlClient
Imports System.Configuration
Imports System.Text
Public Class MDXProjects : Implements IHttpHandler
Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
'Options:
' 0 - Draw Project Boundary on Drawing Layer
' 1 - Draw Project Boundary based on user input of Project Number
'Declare the global script variables
Dim Output As String = "" 'The JavaScript response sent back to the Map API
Dim options As Integer = context.Request.Params("opt")
Dim pnum As String = context.Request.Params("pnum")
'Set up a connection to SQL server
Dim conString = ConfigurationManager.ConnectionStrings("SpatialDB").ConnectionString
Dim myConn = New SqlConnection(conString)
'Dim myConn = New SqlConnection("Data Source=HQ-BW0G5V1\SQLExpress12;Integrated Security=True;Connect Timeout=15;Encrypt=False;TrustServerCertificate=False; database=GeoTest")
'Open the connection
myConn.Open()
'Define the stored procedure to execute
Dim myQuery As String
Select Case options
Case 0
myQuery = "dbo.usp_Projectlimit"
Case Else
myQuery = "dbo.usp_Projectlimit" 'Default
End Select
Dim myCMD As New SqlCommand(myQuery, myConn)
myCMD.CommandType = Data.CommandType.StoredProcedure
If options >= 0 Then 'Need to pass user clicked lat long to database
myCMD.Parameters.Add("@pnumber", Data.SqlDbType.NVarChar)
myCMD.Parameters("@pnumber").Value = context.Request.Params("pnum")
End If
'Create a reader for the result set
Dim myReader As SqlDataReader = myCMD.ExecuteReader()
'Go through the results
While myReader.Read()
Output += myReader("WKT") + "^" + myReader("GeometryType") + "^" + myReader("Title") + "^" + myReader("Description") + "@"
End While
'Close the reader
myReader.Close()
'Close Connection
myConn.Close()
'return the constructed string to Javascript
context.Response.Write(Output)
End Sub Javascript Client that parses the returned recordset string from SQL Server via Web handler above: function buildRecord(record, splitChar) {
/// <summary>
/// parses the list into various fields
/// </summary>
/// <param name="record" type="list">single List item of the xmlHttp response</param>
/// <param name="splitChar" type="string"> Character on which to seperate the various fields</param>
/// <returns type="User Variable">Returns a Class/User type variable containg the various fields</returns>
splitChar = splitChar || "^";
record = record.split(splitChar);
var ObjRec = {};
ObjRec.wkt = record[0];
ObjRec.type = record[1];
ObjRec.title = record[2];
ObjRec.description = record[3];
//optional classification objects if any
var numField = record.length;
switch (numField){
case 5:
ObjRec.attr = record[4];
break;
case 6:
ObjRec.attr = record[4];
ObjRec.attr1 = record[5];
break;
}
return ObjRec;
}
... View more
08-17-2017
07:45 AM
|
1
|
1
|
4627
|
|
POST
|
When I wrote those parsing routines, there were no freely available parsers in existence. Secondly, I was not necessarily interested in parsing the addresses but to "cleanup" some very bad data I received from our tax authority database. Lastly, I cannot claim credit for all the routines -- they are a collection of snippets from lots of python folks... I took a look at the usaddress parser. Sorta funny, I will be getting a 5 Million record dump from the same tax authority shortly and I intend to use the parser suggested by Joshua Bixby this time around. Addresses are very messy as you are finding out ... best to use something that has already been developed! (And is free!). Here in Miami, I have found out that the US Postal system aka address does not always use the official street names and nomenclature so I had to interject a lot of exceptions to clean up the data for my use to relate the addresses to our inventory of roads. BTW: I am attaching a cal file which I used during the cleanup. The cal file imports the script you mentioned and returns the StreetNumber in this example. But in my case I am going the opposite direction you are... I have a bunch of addresses for which I am trying to find a related Roads Inventory street for.....
... View more
07-31-2017
08:38 AM
|
0
|
0
|
2367
|
|
POST
|
That would be a way for presentation. Divided up by regions on different layers, however the real power of GIS is data and serving up that data. I picture a waterfall site having the ability to search by location, near by, parking, hiking, by address ..... your layers now have just become bigger... I am pretty sure the ArcGIS site can work with data and has geo-processing tools such as spatial intersections available to use. Hopefully, someone here who does use the ArcGIS web site can more fully help you out in your context. Doing a little searching... performance - Can ArcGIS Online navigate and identify large GIS datasets? - Geographic Information Systems Stack Exchang… Best practices for using layers in maps—ArcGIS Online Help | ArcGIS Perform analysis—ArcGIS Online Help | ArcGIS
... View more
07-18-2017
12:50 PM
|
3
|
0
|
1676
|
|
POST
|
I don't know if this will help, but may spur some ideas. Currently I use Bing Maps to overlay my GIS stuff on.... (not my preference but the client's). I have my GIS data in SQL server. What I do for displaying large numbers of data points for example "Street Lights" is to query the users exent and do an intersect spatially against the GIS data only returning those street lights in the users current view. My SQL procedure for sending back only data found in the extent sent to it as parameters ul/br lat and long (Upper Left/ Lower Right) USE [GeoTest]
GO
/****** Object: StoredProcedure [dbo].[usp_ColorLightLC] Script Date: 7/18/2017 11:53:37 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: Ted Kowal
-- Create date: 6/21/2013
-- Description: Lights and LC from Map View
-- =============================================
ALTER PROCEDURE [dbo].[usp_ColorLightLC]
-- Add the parameters for the stored procedure here
@ulLat nvarchar(10),
@ulLong nvarchar(10),
@brLat nvarchar(10),
@brLong nvarchar(10)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Create a rectangle geography instance based on bounding box of the Virtual Earth map
DECLARE @SearchRectangleString VARCHAR(MAX);
SET @SearchRectangleString = 'POLYGON((' + @ulLong + ' ' + @ulLat + ',' + @ulLong + ' ' + @brLat + ',' + @brLong + ' ' + @brLat + ',' + @brLong + ' ' + @ulLat + ',' + @ulLong + ' ' + @ulLat + '))';
Declare @G geography;
Declare @SearchArea geometry;
SET @G = geography::STPolyFromText(@SearchRectangleString, 4326);
SET @SearchArea = geometry::STGeomFromWKB((Select @G.STAsBinary()),4326);
Select
Shape.STGeometryType() as GeometryType,
Shape.STAsText() as WKT,
'Light' as Title,
'LoadCenterID: ' + cast(LoadCenterID as nvarchar) as Description,
LoadCenterID,
1 as FT
from
MDXLIGHTS
where
Shape.STIntersects(@SearchArea) = 1 and LoadCenterID <> 998
union all
select
Shape.STGeometryType() as GeometryType,
Shape.STAsText() as WKT,
'LoadCenter' as Title,
'LoadCenterID: ' + cast(LoadCenterID as nvarchar) as Description,
LoadCenterID,
0 as Feat
from LOADCENTERS
where
Shape.STIntersects(@SearchArea) = 1
Order by LoadCenterID ASC, FT DESC
END
... View more
07-18-2017
08:58 AM
|
2
|
1
|
1676
|
|
POST
|
Perform an intersect query your counties against the Ocean/Coast layer. Save that query as a layer and label those in that saved layer.
... View more
07-14-2017
08:58 AM
|
1
|
0
|
775
|
|
POST
|
If you have your data in an access database or in a large format database and you are only updating attributes (no geospatial stuff) try making a query outside of arcGIS within the database itself and make those joins. As a practice, I never use ESRI to update attribute data, unless I absolutely have to (generally due to geo spatial links.)
... View more
06-29-2017
07:24 AM
|
0
|
1
|
1112
|
|
POST
|
What type of database are you using.... wildcards are depended upon the database. If you are using for example a personal geodatabase you would need to use a like '*TCR*'
... View more
06-28-2017
07:35 AM
|
1
|
1
|
929
|
|
POST
|
There is a lot of good stuff listed above, In the course of my work I occasionally have to parse addresses and I get data address dumps from our tax division which are horribly bad! So I have been slowly working on a parser to accommodate this data.... for what it is worth .... (I am still learning python)
... View more
06-19-2017
09:01 AM
|
0
|
0
|
1326
|
|
POST
|
If they are simple text files? Python - Way to recursively find and replace string in text files - Stack Overflow
... View more
06-19-2017
07:49 AM
|
0
|
0
|
733
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10-18-2018 09:46 AM | |
| 1 | 05-23-2018 08:30 AM | |
| 9 | 04-18-2019 07:15 AM | |
| 1 | 05-04-2016 08:15 AM | |
| 1 | 03-24-2017 01:22 PM |
| Online Status |
Offline
|
| Date Last Visited |
10-18-2023
06:40 PM
|