Plotting points in lat-long on map or converting WKID:4326 to XY WKID:102100 in bulk.

Discussion created by niranjan_borawake on Jan 12, 2013
Latest reply on Jan 16, 2013 by jeff.pace

My problem seems to be more common but the solutions provided don't apply in my case. I googled a lot and finally decided to post a question.
Let me start by explaining what I am trying to do:
I have a large set of points (around 40 to 50 thousand) to be plotted which are in latitudes and longitudes.
I created a map with following intialExtent  and base layer:
var initExtent = new esri.geometry.Extent({
                    "xmin" : -9025716.63,
                    "ymin" :4428892.14,
                    "xmax" : -8888129.98,
                    "ymax" : 4520616.57,
                    "spatialReference" : {
                        "wkid" : 102100
var basemap = new esri.layers.ArcGISTiledMapServiceLayer("");

Spatial Reference (SR) for the map is WKID:102100 which does not allow me to plot my points in lat-long (as lat-long can be plotted on a map with SR WKID:4326, "I think so..Please correct if this is not the case " ). So I need to transform these lat-long to X-Y coordinates i.e. in SR WKID:102100. I could find the arcgis's GeometryService to do this but only for points less than 15 at a time, obviously on the arcgis's public server. So there is no way i could transform all those 40-50 thousand points this way.

I tried following things:

  1. Creating the map with SR WKID:4326 and plotting the points in lat-long itself, no conversion required. This plots the points correctly but the map images are not fetched, the images saying "NO map data available" are shown on the map. Is there any relation between type of layer used and SR? I mean is it a case, that certain types of layers support only certain SRs.

  2. Tried to create map with SR WKID:102100 and another layer with WKID:4326 and then plot points on this layer. But this doesn't work, from the api reference of the arcgis I feel all other layers extend the SR of the map/base layer. So there is no way i could have layers with different SR WKIDs.

  3. So finally I came to a conclusion that I need to convert those points from WKID 4326 to WKID 102100. The Geometry service api ref has an option to provide URL based geometries where URL points to a  file with all the points to be converted in JSON format. I could not get this working :(. When I hit the REST API URL{"geometryType"%3A"esriGeometryPoint"%2C"geometries"%3A[{"x"%3A-117%2C"y"%3A34}]} it takes me to the HTML page. How can I make use of this option and convert all those points in bulk.

Please answer following questions :

  1. Is there a way in which I could plot all those points in lat-long itself by creating a map with WKID:4326? If yes, any example?

  2. How can I convert all those points in bulk from SR WKID 4326 to SR WKID 102100? This way I am planning to convert all lat-longs offline and then use them to plot.

Thanks in advance.