I receive following warning after this statement is run: sdf = features.SpatialDataframe(df)
opt/anaconda3/lib/python3.7/site-packages/arcgis/features/_data/geodataset/geodataframe.py:221: UserWarning: SpatialDataFrame has been deprecated. Please switch to the GeoAccessor/GeoSeriesAccessor. warnings.warn("SpatialDataFrame has been deprecated. Please switch to the GeoAccessor/GeoSeriesAccessor.")
What is the correct way to create an 'sdf' now?
Solved! Go to Solution.
Hi art zaifman,
The answer to your question might be found here: Introduction to the Spatially Enabled DataFrame | ArcGIS for Developers
New at version 1.5, the Spatially Enabled DataFrame is an evolution of the
SpatialDataFrame
object that you may be familiar with. While theSDF
object is still avialable for use, the team has stopped active development of it and is promoting the use of this new Spatially Enabled DataFrame pattern. The SEDF provides you better memory management, ability to handle larger datasets and is the pattern that Pandas advocates as the path forward.
HTH,
Egge-Jan
Hi art zaifman,
The answer to your question might be found here: Introduction to the Spatially Enabled DataFrame | ArcGIS for Developers
New at version 1.5, the Spatially Enabled DataFrame is an evolution of the
SpatialDataFrame
object that you may be familiar with. While theSDF
object is still avialable for use, the team has stopped active development of it and is promoting the use of this new Spatially Enabled DataFrame pattern. The SEDF provides you better memory management, ability to handle larger datasets and is the pattern that Pandas advocates as the path forward.
HTH,
Egge-Jan
It does help and thank you for the rapid reply, Egge-Jan!
Short follow-up question: is there a description of the method in which GIS().content.import_data(panda data frame containing lat, lon columns) populates the SHAPE column? Main question is why are the 'x, y' values in the SHAPE column so different from the original 'latitude, longitude' values
Hi art zaifman,
Always happy to help 🙂 If you consider your initial question being answered you might consider to 'close the call' by marking my answer as correct.
Regarding your follow-up question: I guess this has something to do with the use of different coordinate systems being used. It looks like your input latitude and longitude are in WGS84 (EPSG:4326) whereas the coordinates in the SHAPE column are - most probably - in EPSG:3857. (EPSG:3857 is a Spherical Mercator projection coordinate system popularized by web services such as Google and later OpenStreetMap, and also being used by Esri, with WKID:102100).
I guess the points do appear in the right location when plotted on the map, don't they?
BR,
Egge-Jan
The points are mapped correctly and thank you again!
from pyproj import Proj, transform
print(transform(Proj('epsg:4326'), Proj('epsg:3857'), 45.810, -122.691)) # longitude first, latitude second.
(-13657899.64491753, 5749953.689939638)
BTW, here's an excellent reference for how to code bulk transformations using pyproj: High-performance bulk transformation of coordinates
Are these UTM coordinates?
Thanks.
webby stuff is usually in a Web Mercator projection
... so that would be this WKID:102100/EPSG:3857 thing, as I mentioned above.