POST
|
The outFields include all the fields in the locator features plus some the geocoding related fields such as scores, side etc (you could find out what those fields are by geocoding a single address in ArcMap...). that clears it up, thanks for the reply. So, as far as I can tell, there is NO way to retrieve the original address or some 'embedded' unique identifier from the address candidate??? (loosing all pointers to your original address from the candidate just seems... sooo wrong) thanks again!
... View more
01-25-2011
12:16 PM
|
0
|
0
|
197
|
POST
|
this is to allow you to retrieve data from the address candidate, right? but this doesn't work locator.addressToLocations(address, ["anyData"] ); I'm trying to retain the original address geocoded and another unique identifier
... View more
01-21-2011
06:16 AM
|
0
|
2
|
2106
|
POST
|
Hi yall, I'm still a bit confused after doing a bit of research as to what my capabilities are at this point. I've got a couple basic maps up and going with the javascript api and others with the google api. But I've been 'envisioning' a map that uses google's map, script generated kml's (bus stops), and my own arcserver geocoding service. Can I do that? using my geocoder is a must. So, I guess: A) can I add kml through the javascript api? or B) can I use my own geocoder in a google map? Thanks!!!
... View more
10-21-2010
09:02 AM
|
0
|
1
|
460
|
POST
|
nevermind, it worked on the 5th different address I used, not sure why, just gonna keep grinding on ---------------------- using 9.3. I have a map service and geocode service I'm trying to substitute with the ones used in esri's sample, but my map won't perform the geocode/pan/zoom when you click 'locate'. I'm wondering if: var geom = esri.geometry.geographicToWebMercator(candidate.location); won't work right with the NAD_STATE_PLANE projection of my services Bold- altered Purple- taken out due to javascript error from candidate.attributes.Loc_name (which I then tried candidate.attributes.aug_09_co_cl_zip_mod_loc2, to no avail)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<!--The viewport meta tag is used to improve the presentation and behavior of the samples
on iOS devices-->
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/>
<title>Find Address</title>
<link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.1/js/dojo/dijit/themes/claro/claro.css">
<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.1"></script>
<script type="text/javascript">
dojo.require("esri.map");
dojo.require("esri.tasks.locator");
var map, locator;
function init() {
var initExtent = new esri.geometry.Extent({"xmin":650000,"ymin":630000,"xmax":700000,"ymax":660000,"spatialReference":{"wkid":102651}});
map = new esri.Map("map", { extent: initExtent});
var tiledMapServiceLayer = new esri.layers.ArcGISDynamicMapServiceLayer("http://fpscnsde:8399/arcgis/rest/services/transportation2/MapServer");
map.addLayer(tiledMapServiceLayer);
locator = new esri.tasks.Locator("http://fpscnsde:8399/arcgis/rest/services/tran_geocode2/GeocodeServer");
dojo.connect(locator, "onAddressToLocationsComplete", showResults);
}
function locate() {
map.graphics.clear();
var add = dojo.byId("address").value.split(",");
var address = {
Street : add[0],
Zone: add[1]
};
locator.addressToLocations(address,["aug_09_co_cl_zip_mod_loc2"]);
}
function showResults(candidates) {
var candidate;
var symbol = new esri.symbol.SimpleMarkerSymbol();
var infoTemplate = new esri.InfoTemplate("Location", "Address: ${address}<br />Score: ${score}<br />Source locator: ${locatorName}");
symbol.setStyle(esri.symbol.SimpleMarkerSymbol.STYLE_DIAMOND);
symbol.setColor(new dojo.Color([255,0,0,0.75]));
var points = new esri.geometry.Multipoint(map.spatialReference);
for (var i=0, il=candidates.length; i<il; i++) {
candidate = candidates;
if (candidate.score > 70) {
var attributes = { address: candidate.address, score:candidate.score, locatorName:candidate.attributes.Loc_name };
var geom = esri.geometry.geographicToWebMercator(candidate.location);
var graphic = new esri.Graphic(geom, symbol, attributes, infoTemplate);
map.graphics.add(graphic);
map.graphics.add(new esri.Graphic(geom, new esri.symbol.TextSymbol(attributes.address).setOffset(0, 8)));
points.addPoint(geom);
}
}
map.setExtent(points.getExtent().expand(3));
}
dojo.addOnLoad(init);
</script>
</head>
<body class="claro">
Address : <input type="text" id="address" size="60" value="519 W Dickson, 72701" /> <i>(Address, City, State, Zip)</i>
<input type="button" value="Locate" onclick="locate()" /><br />
<br />
<div id="map" style="width:1200px; height:600px; border:1px solid #000;"></div>
</body>
</html>
when I click 'locate', it moves the map slightly (and incorrectly) and I then loose the ability to pan this is my second day of trying to figure this out, thanks to anyone!
... View more
10-20-2010
10:22 AM
|
0
|
0
|
486
|
POST
|
Thanks a bunch! that got me on the right track. Although, sadly, I thought I'd be getting back a lat/long values as the x/y. I'm starting with a shapefile of nad/stateplane, project it to geographic, and want to then extract all the lat/long values (all within the script). *sigh* back to google... edit: nevermind, it works, I forgot to uncomment the projection command, lol. here is some code: rows = gp.UpdateCursor(proj_shp) row = rows.Next() while row: feat = row.shape pnt = feat.GetPart(0) print "x: " + str( pnt.x )
... View more
09-22-2010
01:59 PM
|
0
|
0
|
1195
|
POST
|
I'm opening a point shapefile cursor, while row: ... shouldn't it be something like: row.shape.x ?? I've tried for many hours looking for this answer online to no avail. Is there no api? I don't see Shape 'class' on the "Geoprocess Object Model", what am I missing?
... View more
09-22-2010
12:49 PM
|
0
|
4
|
14051
|
POST
|
Very simple problem. I've exported a geoprocessing script to vbs from Model Builder. Opened Excel > Create Macro (VB opens) > paste vbs code in > hit run, and get an 'object required' error on the first line: Set gp = WScript.CreateObject("esriGeoprocessing.GPDispatch.1") I'm assuming I need to import/include the path to a com library or dll for VB to recognize. I saw a code snippet that accesses a method with a guid, but I doubt that's the right approach. Thanks in advance, very much! ps: I'd be using python but there is a small portion of vb that get exported into the python script and I can't find a python geoprocessing api to replace the vb code
... View more
09-02-2010
01:34 PM
|
0
|
1
|
744
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|