Spatially Enabled Dataframe

929
4
Jump to solution
01-16-2019 08:39 AM
OisinSlevin
New Contributor III

Hi Guys,
Having an issue with a projection where the projection is off by 70 meters

example:

gis = GIS("url", "user", password)
content=gis.content.get("ID") 

layers=content.layers

 

points=pd.DataFrame.spatial.from_layer(layers[0])

points['SHAPE']=points['SHAPE'].geom.project_as(29900)

my source data is in  EPSG:2157 but i need EPSG:29900, when I view the source data in an eternal package it aligns with the the backround map,

if I project to EPSG:29900 I'm roughly 70meters off from the basemap

if i project_as EPSG:4326 it seems to work with no issues and aligns with the base map. 

Is there any known issues or any other ways to changing coordinate systems.

have had the same issue using spatial DataFrame and Spatially Enabled Dataframe. 
I've also used geopandas to convert the data and that works perfectly so I'm nearly certain there is an issue.

0 Kudos
1 Solution

Accepted Solutions
simoxu
by MVP Regular Contributor
MVP Regular Contributor

I suspect the projection was done as expected.

Could you try this:

gis = GIS("url", "user", password)
content=gis.content.get("ID") 

layers=content.layers


#points=pd.DataFrame.spatial.from_layer(layers[0])
#points['SHAPE']=points['SHAPE'].geom.project_as(29900)

feature_layer = layers[0]
fset = feature_layer.query(out_sr=29900)
sdf1 = fset.sdf

# then you can export the sdf1 as other formats if you like

The difference is the projection will be done on the server rather than in the browser, at least this is what I am guessing

View solution in original post

4 Replies
JoshuaBixby
MVP Esteemed Contributor

Is it just between EPSG:2157 and EPSG:29900 or can you reproduce between other combinations?  Also, what if you try from EPSG:2157 to EPSG:29902 ?  According to several sites, EPSG:29900 is deprecated, so maybe that is causing an issue with the transformation.

0 Kudos
OisinSlevin
New Contributor III

I've tried using 29902, I've also tried converting from 2157 to 4326, and then projecting to 29902, so I think its just an issue with the projection to 29902.

0 Kudos
simoxu
by MVP Regular Contributor
MVP Regular Contributor

I suspect the projection was done as expected.

Could you try this:

gis = GIS("url", "user", password)
content=gis.content.get("ID") 

layers=content.layers


#points=pd.DataFrame.spatial.from_layer(layers[0])
#points['SHAPE']=points['SHAPE'].geom.project_as(29900)

feature_layer = layers[0]
fset = feature_layer.query(out_sr=29900)
sdf1 = fset.sdf

# then you can export the sdf1 as other formats if you like

The difference is the projection will be done on the server rather than in the browser, at least this is what I am guessing

OisinSlevin
New Contributor III

Thanks this fixes my issue, although I'm still concerned if projections don't match ? 

0 Kudos