Project geometries in an spatial dataframe fails with code 498

770
0
11-27-2022 02:15 AM
TomGeo
by
Occasional Contributor III

I need to project geometries in an spatial dataframe and try to do it with this code

 

import pandas as pd
from arcgis import geometry
from arcgis.features import GeoAccessor, GeoSeriesAccessor

in_csv = r'C:\Path\to\points.csv'
point_df = pd.read_csv(in_csv, sep=';')
point_df = pd.DataFrame.spatial.from_xy(point_df, x_column='Longitude', y_column='Latitude', sr=4326)
point_df['SHAPE'] = geometry.project(geometries=point_df['SHAPE'], in_sr=4326, out_sr=3006)

 

A check on the geometry column in the SeDF returns

TomGeo_0-1669543556653.png

I am logged into our Enterprise portal when running the code, and I am getting:

Exception: Invalid Token
(Error Code: 498)

 

I am running ArcGIS Pro 3.0.2, our portal is in version 10.9 and arcgis is in version 2.0.1

PS: I am getting the same error when trying to find the transformation needed to do the projection

 

arcgis.geometry.find_transformation(in_sr=4326, our_sr=3006)

 

 

- We are living in the 21st century.
GIS moved on and nobody needs a format consisting out of at least three files! No, nobody needs shapefiles, not even for the sake of an exchange format. Folks, use GeoPackage to exchange data with other GIS!
0 Kudos
0 Replies