POST
|
Brad, Thanks for the reply! 1. It's good to know. So you mean the world geocoder "findAddressCandidates" is different from our "findAddressCandidates" out of the box, (extra sorting after the fact)? Why cannot we get the same? It will be even better if "geocodeAddresses" does sorting after the fact too. But of course then some users might complain about not honoring the priority of the first locator if both addresses are "acceptable"....Therefore I guess for now we just have to mimic world geocoder to do sorting after the fact on our side? 2. I don't think I will do this since it's a batch geocoder we use to geocode thousands of addresses every day, and I don't want to tweak the setting just for these "special" cases at a risk of breaking others. 3. I guess we could give much more weight to the street directional in the .xml file? Then that's a lot of digging and testing there... Thanks a lot for the input! Jian
... View more
06-01-2015
01:33 PM
|
0
|
4
|
2735
|
POST
|
Bruce, Yes, you are exactly right. Sorry I forgot to mention we are using a composite locator from Streetmap Premium. It's exactly that "Point address with acceptable score elevated above street address with perfect score" as you said. How can we avoid that to happen? I see the world locator seems to also use a "composite" locator and it does a good job there, maybe it sets streetAddress over pointAddress, or it does some extra work elsewhere? We do want pointAddress over streetAddress though since pointAddress is theoretically more accurate (or precise), although it's not the case here. Would you please share more insights on this? Thank you and much appreciated. Jian
... View more
06-01-2015
12:43 PM
|
1
|
6
|
2735
|
POST
|
Bruce Harold, Bruce, Thanks for the insight, this is helpful! I have also been trying to understand the internal algorithm used for ESRI geocoding. One thing I find strange is that when there are multiple candidates found for an address, the geocoder will pick whatever the first one, instead of the "best" one. For example, a search for address "2725 30TH STREET SE, Washington DC" will get a match at "2725 30th St NE, Washington, District of Columbia, 20018" with a score of 92.43, when geocoded using ArcMap. The match is wrong, due to the street directional. Of course, a manual rematch will find a 100 match, but this won't be feasible for batch geocoding. Below shows all candidates returned by findAddressCandidates REST API, but geocodeAddresses will only return the first one that is in fact wrong. The desktop geocoder is the same as geocodeAddresses. I imagine this is done for performance/speed reasons? But this is not right. What can we do to avoid the wrong matches? One options would be to redo the filtering algorithm by picking the biggest score if using findAddressCandidates. But anything for geocodeAddresses? Thanks and it's much appreciated! Jian ####search for address "2725 30TH STREET SE, Washington DC", return by findAddressCandidates:##### Address Candidates: (# address candidates : 6) Shape: Point: X: -76.9664981241894 Y: 38.92517585657543 Score: 92.43 Address: 2725 30th St NE, Washington, District of Columbia, 20018 Shape: Point: X: -76.965586314324 Y: 38.85502946852702 Score: 100.0 Address: 2725 30th St SE, Washington, District of Columbia, 20020 Shape: Point: X: -76.96649984530907 Y: 38.92482786588191 Score: 92.43 Address: 2725 30th St NE, Washington, District of Columbia, 20018 Shape: Point: X: -77.06011761652377 Y: 38.92385066586513 Score: 92.43 Address: 2725 30th St NW, Washington, District of Columbia, 20008 Shape: Point: X: -76.96636920394947 Y: 38.920916363073836 Score: 83.35 Address: 2725 30th Pl NE, Washington, District of Columbia, 20018 Shape: Point: X: -76.96552627725934 Y: 38.85500159493757 Score: 79.0 Address: 2726 30th St SE, Washington, District of Columbia, 20020
... View more
06-01-2015
09:22 AM
|
1
|
10
|
2735
|
POST
|
Bjorn, I've tested simplifying the donut polygon before intersecting, but still the same result -- returns nothing. In fact, I am not using geometryservice.intersect. I use FeatureLayer.queryFeatures(query,..) and query.spatialRelationship = "esriSpatialRelIntersects". I assume simplify is also required before using this spatial query? Any other thing you might think of that could cause this (no points returned even though they are there)? Thank you and it's much appreciated.
... View more
08-28-2014
01:05 PM
|
0
|
1
|
578
|
POST
|
Bjorn, Thanks for the reply. Yes, I am using ArcGIS 10.0. So "simplify" is only necessary to clean any inconsistent topology (self intersecting polygon etc.). Otherwise, the intersection should work with any topologically sound geometry? I am intersecting a "donut" polygon with a point layer to select points falling within the donut shape. I know there are points within the donut, however, the intersection doesn't return anything. Do you know what problem this might be? Do you think the drawing order of the vertices might cause a problem? (say topologically the outline polygon should be clockwise while the inner one should be counter clockwise. And when I passing in the arrays, they could be in the same direction and it's topographically wrong? ) I will test simplifying first before intersecting and see what happens. And I will appreciate any insight into this. Particularly, when I visualize the donut polygon, it looks fine. Also I've calculated perimeter and area of the donut polygon using geometry service. The perimeter looks right, but the polygon area is Strange. Thanks, Jian
... View more
08-25-2014
01:57 PM
|
0
|
3
|
578
|
POST
|
This has been bothering me for many days and hope someone here may have an answer. Is it mandatory to generalize a ("complex") geometry before feeding it to the intersection operation of geometry service? I was told so, but couldn't find any documentation about this. For example, we may have to reduce the number of vertices of a geometry to <250(??) in order for the intersection to work. But this sounds really strange to me. ArcGIS server cannot even handle geometries over 250 vertices? But I do see intersection doesn't seem to return anything for complex geometries. I am surely missing something. Any advice is much appreciated. Thanks a ton! Jian
... View more
08-22-2014
08:38 AM
|
0
|
5
|
2144
|
POST
|
I'm a little unclear on what you're trying to do once you get the file into State Plane, but the process to getting it there could go something like this. Note that here, I'm explicitly converting from WGS84 to State Plane: arcpy.overwriteOutputs = True
csvfile = r"C:\Users\meiben\Desktop\test\fires.csv"
lat_g = "lat_g"
long_g = "long_g"
outlayer = "xyEventlayer"
arcpy.MakeXYEventLayer_management(csvfile, long_g, lat_g, outlayer,arcpy.SpatialReference(4326))
arcpy.CopyFeatures_management(outlayer,"templayer")
arcpy.Delete_management(outlayer)
arcpy.Project_management("templayer","coord_conv",arcpy.SpatialReference(26771))
arcpy.Delete_management("templayer") A couple changes that I made here was using the Spatial Reference method instead of pointing to a file on the system. outlayer,arcpy.SpatialReference(4326) = GCS WGS 84 arcpy.SpatialReference(26771) = PCS NAD_1927_StatePlane_Illinois_East_FIPS_1201 Check out the following URL for a list of all the codes: http://resources.arcgis.com/en/help/main/10.1/018z/pdf/projected_coordinate_systems.pdf At the end of this script, you should have a feature layer to do whatever you like with. Hope this helps! Matt Thanks Matt for the reply! I wanted to use SearchCursor to do the projection on the fly (http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//000v00000039000000) and the code after the reprojection is just to print out the new coordinates for testing purposes, and that's where I got (nan,nan). I wanted to use SearchCursor because it doesn't write anything to the harddrive, but the Project_management function would work too. I had just found out why my code failed -- it's not particularly due to the XYEventLayer, which I thought might give a problem to the on-the-fly projection. It is in fact due to bad coordinates in my file. The projection failed without giving an error. As to the spatial reference input parameter, I think both the actual object and the string path would work. But it was also a factor that I had to filter out to pin down the problem. -- Sometimes arcpy is very confusing as to when it takes a string path or an actual object as input. There is no clear documentation at times, and it takes a long time to figure things out. Painful. Thanks for the help, much appreciated!
... View more
05-01-2014
08:31 AM
|
0
|
0
|
841
|
POST
|
Joshua, It is MUCH FASTER! It just took seconds to export the file, about the same as using Export Data. Just curious why CopyFeatures and featureClassToFeatureClass would be that slow... But thanks a lot and appreciate it! Jian Hello Jian, I think you can use arcpy.Select_analysis the same as arcpy.FeatureClassToFeatureClass_conversion and arcpy.CopyFeatures_management. Just don't specify a where statement and it will export all records in the input feature layer. I don't think it would be any faster than arcpy.FeatureClassToFeatureClass_conversion or arcpy.CopyFeatures_management, but it might be worth a try.
... View more
04-30-2014
01:02 PM
|
1
|
0
|
1268
|
POST
|
Joshua, Thank you very much for the reply! But I don't see how Select Analysis will help me to do the export faster? I want to export all the features.... Jian
... View more
04-30-2014
11:26 AM
|
0
|
0
|
1268
|
POST
|
I have an excel file (or in fact converted to csv for easy use. Arcpy seems to be buggy about excel files...) with some lat/long coordinates that I would need to add corresponding projected coordinates. The way I can think of doing this is to use the MakeXYEvent to create an event layer, then reproject the layer and add the projected X and Y. Implementation: import os, arcpy, sys, traceback
from xlrd import open_workbook
import xlwt
arcpy.overwriteOutputs = True
projectionsPath = r"C:\Test\_UtilityScripts\Coordinate Systems_CopiedFromArcMap\Projected Coordinate Systems\State Plane\NAD 1983 (Meters)"
csvfile = r"C:\Test\6_USA_FIPs\excel\latlong_seperated\IL.csv"
lat_g = "lat_g"
long_g = "long_g"
outlayer = "xyEventlayer"
#savedlayer = r"C:\Test\6_USA_FIPs\python\temp\xyOutput.lyr"
#outputSHP = r"C:\Test\6_USA_FIPs\python\temp\xyOutput.shp"
if arcpy.Exists(outlayer):
arcpy.Delete_management(outlayer)
srGCS = os.path.join(r"C:\Test\_UtilityScripts\Coordinate Systems_CopiedFromArcMap\Geographic Coordinate Systems\North America", "NAD 1983.prj")
srPRJ = os.path.join(projectionsPath, "NAD 1983 StatePlane Illinois East FIPS 1201 (Meters).prj")
arcpy.MakeXYEventLayer_management(csvfile, lat_g, long_g, outlayer, srGCS)
rows = arcpy.SearchCursor(outlayer, "", srPRJ)
row = rows.next()
feat = row.Shape
pnt = feat.getPart()
print pnt.X I am using SearchCursor above with on the fly projection for coordinate conversion. But I am always getting coordinates of (nan, nan)??? I've tested the syntax with other shapefiles, and it should work... Anything special with this xyevent layer? Please help, thanks people!
... View more
04-30-2014
10:40 AM
|
0
|
3
|
2127
|
POST
|
I need to export an xyEvent layer to a shapefile. It is a big file with about 59000 records. When I used the context-sensitive menu/Data/Export Data option in ArcMap, the export took only a few seconds. However, when I try to implement it in Arcpy, it doesn't seem that I can find the right function that can perform this fast. I've tried arcpy.FeatureClassToFeatureClass_conversion and arcpy.CopyFeatures_management Each one takes minutes to finish. Is there another function I should use? I am using 10.1. Thanks people!
... View more
04-30-2014
10:24 AM
|
0
|
5
|
2852
|
POST
|
Hi Kroll, I am struggling with using ITableView on a windows form. I used a picturebox to put ITableView on, but that caused problems with editing on the tableview. Could you please tell me if your ITableView is on a windows form, and if so how you realize that? It will be much appreciated. Regards, Jian
... View more
02-23-2011
08:35 AM
|
0
|
0
|
150
|
POST
|
I've just realized that this may be due to "coordinate precision". See: http://www.ian-ko.com/resources/Topology_Problems_2.htm for a good explanation. Knowing how this happened and not wanting to creating an vertex on the original curve (which will slightly nudge the curve due to coordinate grid), I am wondering if and how I may apply some kind of "tolerance" to the spatial relationships? For example, I want anything falling within the tiny tolerance (the coordinate precision in my case) to be recognized as "touch", instead of "intersect" or "disconnect"... Please advise..Thanks!
... View more
08-30-2010
12:41 PM
|
0
|
0
|
528
|
POST
|
Yes, I would first try projecting your intermediate point to match the curve geometry, and see if that helps. Also, is any of your data Z aware? Regarding snapping, most likely the point is within the tolerance and that is why it is not moving. If nothing is helping, perhaps you could zip up a small amount of data and your code and someone can take a look... Thanks Jeff. This is the code for a single feature: //create a new intermediate point IPoint tempPoint = new PointClass(); tempPoint.SpatialReference = segment.SpatialReference; //does the interpolation and assign it to tempPoint. It turns out tempPoint is NOT ON the curve segment.QueryPoint(esriSegmentExtension.esriNoExtension, ((double)houseNumber - (double)from) / ((double)to - (double)from), true, tempPoint); //tried IProximityOperator to move the point, to no avail IProximityOperator proxOp = segment as IProximityOperator; interpolatedPoint = proxOp.ReturnNearestPoint(tempPoint, esriSegmentExtension.esriNoExtension); //also tried SnapEnvironment to move the point, to no avail. Any advice will be appreciated. Thanks!
... View more
08-30-2010
10:08 AM
|
0
|
0
|
528
|
POST
|
I just checked, they (data frame, curve file and interpolated point file) are all in the same system. I use intermediate pointClass() in the program, do I need to set their spatial reference as well? If that is not set, could that cause the problem? I've also tested using the SnapEnvironment to snap the point to the curve, but even after reported successfully snapped, the points are not moved/snapped at all. Could this have anything to do with tolerance?
... View more
08-30-2010
07:25 AM
|
0
|
0
|
528
|
Title | Kudos | Posted |
---|---|---|
1 | 04-30-2014 01:02 PM | |
3 | 06-27-2019 04:30 PM | |
2 | 06-27-2019 04:14 PM | |
1 | 06-01-2015 09:22 AM | |
1 | 06-01-2015 12:43 PM |
Online Status |
Offline
|
Date Last Visited |
11-18-2020
06:40 PM
|