spatialReference

5195
10
08-19-2014 09:38 AM
GianniRossi
New Contributor

Hello,

I’m totally new to the ESRI world but I would like to become a ESRI user for my company, a software house developing local area maps management.

So my questions are very basic: I’ve come across to a database of points having the following structure:

geometry: {

- rings: [

   - [

       - [

1250201.0937266531,

5720625.987363001

          ],

   .... other elements

         ]

     ],

  - spatialReference: {

       wkid: 102100,

       latestWkid: 3857

    }

}

I would like to know:

1) What is the reference system of the coordinates ?

2) What are the data in the spatialReference brackets ?

Thanks in advance,

Gianni

0 Kudos
10 Replies
XanderBakker
Esri Esteemed Contributor

It basically indicates the spatial reference with a well known ID that Esri and other software packages understand and can relate X, Y coordinates to a location on the earths surface.

The spatial reference can be defined using a well-known ID (wkid) or well-known text (wkt). The well-known id for a given spatial reference can occasionally change. For example, the WGS 1984 Web Mercator (Auxiliary Sphere) projection was originally assigned wkid 102100, but was later changed to 3857. To ensure backward compatibility with older spatial data servers, the JSON wkid property will always be the value that was originally assigned to an SR when it was created.

Starting at 10.1 an additional property, latestWkid, will identify the current wkid value (as of a given software release) associated with the same SR.

Source: Geometry Objects

ESRI:102100: SR-ORG Projection -- Spatial Reference

Kind regards, Xander

GianniRossi
New Contributor

Hello Xander,

Thanks for your reply.

Unfortunately, as I said, I’m completely new to the ESRI world, so I’ll study the docs at the links you posted.

In the mean time, I would like to ask you about those coordinates values:

1250201.0937266531,

5720625.987363001

Do they refer to a specific ESRI SR?

If so, is there a way to transform them into another SR such as UTM or WGS84 latitude/longitude?

Also, could you please address me to a basic introduction of ESRI concepts and software?

Thanks in advance,

Gianni

0 Kudos
XanderBakker
Esri Esteemed Contributor

Hi Gianni,

If the coordinates you posted are in Italy (about 38km North-East of Verona, near something called "Crespadora") then the coordinates are definitely Web Mercator (Auxiliary Sphere). With a GIS it is possible to project coordinates between different coordinate systems. You can read more about this in the guide book on map projections: What are map projections?

The "database" that you have is basically a json file.  This is a JavaScript Object Notation that is commonly used in web services to interchange sets of data (including geometries). More on this format can be found in the REST specification.

If you are planning to develop with Esri software, the place to start would be ArcGIS for Developers‌. You will find links to all the software SDK's and API's.

If you want to use the desktop software then the Help is a place where you can find a lot of information:

ArcGIS Help (10.2, 10.2.1, and 10.2.2)

There is also a link to Understanding GIS | ArcGIS for Professionals

Esri also has a training site that provides an number of free training courses:

Esri Training

An example of a free course is:

Esri Training | Getting Started with GIS

Kind regards, Xander

0 Kudos
GianniRossi
New Contributor

Hi Xander,

Thank you for your quick reply.

Yes, the coordinates I sent are from that region, Italy – Venice area.

I’ll study the docs you mentioned, but since my immediate task is to convert those coordinates into WGS84 latitude/longitude, could you please address me to the specific doc or ESRI software to do so.

I have many files like that containing thousands points, so I need a way to input all these files and obtain the WGS84 latitude/longitude for all of them.

Thanks in advance.

Gianni

0 Kudos
XanderBakker
Esri Esteemed Contributor

It really depends on the tools you have available and are planning to use and what type of result you want to obtain.

Let´s say you have access to ArcGIS for Desktop. In that case you will have to convert the json files to a single or multiple featureclasses using the Web Mercator projection. The next step is to project the featureclasses to WGS 1984 (if that is what you want). What do you want to do with the result?

To avoid doing this by hand, you can create a python script to do this. If you are willing to provide more information on the folder structure where you have stored the json file and the corresponding naming or are willing to post a few example files, I might be able to create a script to translate the coordinate to WGS 1984.

Kind regards, Xander

0 Kudos
GianniRossi
New Contributor

Hi Xander,

What I need to do is to export on Google Earth the points included in the JSON files, that’s why I want to convert the coordinates into WGS84 latitude/longitude.

As I said, I don’t even know what ESRI software I need, but if you say that ArcGIS for Desktop can provide the solution I’m more than willing to purchase it.

The only thing that I’m afraid of is the lack of time for learning a new software, because my schedule for this task is very short.

So I would be very grateful if you could create the script you mentioned for me, please find in the link below a sample of the files I have to convert.

http://www.corrmap.com/download/SanPietro.txt‌

Many thanks for your help.

Gianni

0 Kudos
XanderBakker
Esri Esteemed Contributor

Hi Gianni,

It sounds like a bit of an overkill to buy ArcGIS just for converting a set of json files. I'm sure there are other (free) options that can do the job. You mentioned that you want the points inside the file converted to WGS1984. The content of the json you send is a polygon (area).

In case you want to use ArcGIS for it (maybe you can download a trail version), you can use some python script to convert the file. Since at this location I only have access to 10.1, the options to convert json are a bit limited. Below you'll find a Python script (using ArcGIS) that converts the json to a kmz file (WGS1984). I'm sure there must be easier ways to do this. I'll attach the kmz file so you can have a look if this type of information is what you ware looking for.

import arcpy, json

arcpy.env.overwriteOutput = True

json_file = r"D:\Xander\GeoNet\SanPietroJSON\json\SanPietro.json"

out_shp = r"D:\Xander\GeoNet\SanPietroJSON\shp\SanPietro_merc.shp"

out_shp_wgs = r"D:\Xander\GeoNet\SanPietroJSON\shp\SanPietro_wgs84.shp"

out_kmz = r"D:\Xander\GeoNet\SanPietroJSON\kmz\SanPietro.kmz"

# spatial references

sr_in = arcpy.SpatialReference(102100) # Web Mercator

sr_wgs = arcpy.SpatialReference(4326)  # WGS 1984

# process json file

dct = eval(open(json_file).read())

lst = dct["results"]

dct2 = lst[0]

geom = dct2["geometry"]

rings = geom["rings"]

# create feature(s)

features = []

for feature in rings:

    features.append(arcpy.Polygon(

        arcpy.Array([arcpy.Point(*coords) for coords in feature])))

# create featureclass (shp)

arcpy.CopyFeatures_management(features, out_shp)

# define projection

arcpy.DefineProjection_management(out_shp, sr_in)

# project to WGS1984

arcpy.Project_management(out_shp, out_shp_wgs, sr_wgs)

# create featurelayer

arcpy.MakeFeatureLayer_management(out_shp_wgs, "WGSpoints")

# convert to KMZ

arcpy.LayerToKML_conversion("WGSpoints", out_kmz)

Kind regards, Xander

BjornSvensson
Esri Regular Contributor

Gianni,

That file looks like the output from an ArcGIS Server. If so, and you still have access to where the data came from, you could just change the spatial reference output parameter to get it in whatever spatial reference you would like (for example 4326 for latitude/longitude).

In addition to using Python...

You could use the Javascript API to do it if you're familiar with JavaScript. Documentation at http://js.arcgis.com .  Or if you prefer other programming languages, see https://developers.arcgis.com/documentation/.

Or you could use the ArcGIS GeometryService to do it for you. With just some minor changes to your files, you could get it converted like I did with your example file: Project (GeometryServer)‌.

Documentation at http://resources.arcgis.com/en/help/arcgis-rest-api/#/Project/02r3000000pv000000/.

0 Kudos
GianniRossi
New Contributor

Hi Bjorn and Xander,

Many thanks for your help and sorry for this late feedback.

I’m still studying the requirements of my application in order to understand the tools I need, so I really hope that you can help me once again.

I also have points in UTM ETRF2000 (2008) coordinates to be transformed into WGS84 latitude/longitude, i.e.:

X_UTM     | Y_UTM      |  Z_UTM |
668800,63 | 5107346,26 |  613,10 |
667659,64 | 5107094,29 |  582,94 |
668729,02 | 5106394,49 |  469,46 |

Bjorn, I guess I could use the ArcGIS Geometry Service you told me, can’t I? If so, could you please tell me the Input Spatial Reference ID for UTM ETRF2000?

Thanks again.

Gianni

0 Kudos