|
POST
|
I'm creating a SEDF from a shape file and removing the features from it, but I keep one feature as a Template.
... View more
01-24-2019
09:43 AM
|
0
|
0
|
4265
|
|
POST
|
# currently reading in a shapefile to get headers (saves creating the Spatially enabled DataFrame from scratch) # I remove all rows but keep a deep copy of one record called record_template # make a record to set values on record_to_append=record_template.copy(deep=True) # in code generating new_line using shapely linemerge (taking multiple line sections making one long route) # for this example I took a sample see below new_line = [[306572.786, 227598.16], [306581.202, 227591.756999999], [306585.583, 227587.403999999], [306589.315, 227583.198999999]] record_to_append.SHAPE['paths']=[new_line] record_to_append.Name="Some Value" # attempting to use deep copy to fix the issue (no change) SDF=SDF.append(record_to_append.copy(deep=True),ignore_index=True) # I've also attempted to put the record into a dict but with the same result dict_to_append=record_to_append.to_dict() SDF=SDF.append(dict_to_append,ignore_index=True) # When I view the records the Name value will change per record as expected, but the SHAPE value of all # records is always equal to the most recent record appended
... View more
01-24-2019
07:34 AM
|
0
|
2
|
4265
|
|
POST
|
Its just SHAPE, have to write a cheat for writing back to arc online where I record the SHAPE in a standard python list and insert it into the json for uploading
... View more
01-23-2019
07:56 AM
|
0
|
0
|
4265
|
|
POST
|
I've created a blank spatially Enabled Dataframe with columns, I'm attempting to append an a row to the Dataframe, which I'm doing successfully, but as I append a row it overwrites the SHAPE column of all previous rows. sdf.append(some_row, ingore_index=True)
... View more
01-23-2019
05:40 AM
|
0
|
16
|
6858
|
|
POST
|
Found the issue, The features layer had user attributes which were "esriFieldTypeGUID" and if you leave them null, but leave them in the "attributes" while adding them , then it throws this error.
... View more
01-18-2019
04:07 AM
|
1
|
0
|
863
|
|
POST
|
Thanks this fixes my issue, although I'm still concerned if projections don't match ?
... View more
01-18-2019
02:51 AM
|
0
|
0
|
2743
|
|
POST
|
Hi, I keep running into this issue when trying to add polygons to my feature layer, My code basically pulls down a feature from a layer, modifies some of the text fields then attempts to upload the feature to a different feature layer The same code works fine for line and point geometry data I also strip out any fields that are auto populated ex GlobalID and OBJECTID so this unique identifier is not something I feed in. an_object={ "geometry":object.SHAPE, "attributes":attributes } add_result=some_layers[6].edit_features(adds=[an_object]) {'addResults': [{'objectId': None, 'uniqueId': None, 'globalId': '09846522-E815-405F-98C5-22991AA70D59', 'success': False, 'error': {'code': 1000, 'description': 'Conversion failed when converting from a character string to uniqueidentifier.'}}], 'updateResults': [], 'deleteResults': []}
... View more
01-17-2019
06:27 AM
|
0
|
1
|
980
|
|
POST
|
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.
... View more
01-17-2019
02:45 AM
|
0
|
0
|
2743
|
|
POST
|
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.
... View more
01-16-2019
08:39 AM
|
0
|
4
|
3225
|
|
POST
|
Thanks all the same, its seems crazy to me to have a spatial system and only show examples of data queries using sql. I've been digging through the docs arcgis.features module — arcgis 1.5.2 documentation already. and the introduction piece is utterly useless of spatial data.
... View more
01-16-2019
07:50 AM
|
3
|
0
|
2414
|
|
POST
|
Thanks Aaron. Is there anywhere where these types of spatial queries are documented, or examples as I can only find SQL queries on Spatially enabled Dataframes
... View more
01-16-2019
07:04 AM
|
0
|
2
|
2414
|
|
POST
|
Hi Guys, Attempting to use the new "Spatially Enabled DataFrame " after getting familiar with Spatial Dataframes. The new version seems to have some functionality of "Spatial" queries stripped out ? There's no "within", "contains", "touches" etc. at a DataFrame level only at Series level? example: gis = GIS("url", "user", password) content=gis.content.get("ID") layers=content.layers points=pd.DataFrame.spatial.from_layer(layers[0]) polygons=pd.DataFrame.spatial.from_layer(layers[1]) if I try to take a polygon and find what points are within it I can no longer run a single query as such : Using SpatialDataFrame I Can use this piece of code: a_polygon=polygons.ix[0] result = points.within(a_polygon.SHAPE) ## returns true/false for each point denoting if inside the polygon. points_inside_polygon= points.loc[result] ## gives total list of points inside of the polygon. is there still a way to run a group query as I can only run a one by one test ? Ex: points.ix[0].SHAPE.within(polygons.ix[0].SHAPE) ## returns true/false if single point is within the polygon Using version 1.5.2 of ArcGis. Also all the examples using the spatially Enabled DataFrame from your documentation are using simple SQL queries on the text fields. Spatial queries should be based on the geometries not the fields associated with geometries.
... View more
01-16-2019
06:39 AM
|
0
|
4
|
2664
|
|
POST
|
Thanks, that has fixed my issue, I was trying initially to use Spatially-Enabled DataFrame as I've only recently installed arcgis pro I assumed the latest version of arcgis would be installed.
... View more
01-11-2019
09:17 AM
|
0
|
1
|
2322
|
|
POST
|
I'm using the python environment from ArcGis pro, but where the arcgis package version is 1.4.1 and it says my python packages are up to date.
... View more
01-11-2019
08:41 AM
|
0
|
3
|
2322
|
|
POST
|
Hi, I'm trying to export a SpatialDataFrame which I've imported from ArcGis Online as such: gis = GIS("site_url", "username", password) feature_layers=gis.content.get("some_id") all_layers=feature_layers.layers #get all layers SDF= SpatialDataFrame.from_layer(all_layers[0]) I need to use the SpatialDataFrame to do some spatial queries to modify the data, (text fields) When I try to export to a ShapeFile I get this error: SDF.to_featureclass("output_folder","output_file.shp") >>The following rows could not be written to the table: 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28 If I try : SDF.to_featureclass("output_folder","output_file.shp", skip_invalid=False) Traceback (most recent call last): File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\features\_data\geodataset\io\fileops.py", line 579, in to_featureclass icur.insertRow(row) RuntimeError: Cannot find field 'b' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<pyshell#26>", line 1, in <module> SDF.to_featureclass("output_folder","output_file.shp",skip_invalid=False) File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\features\_data\geodataset\geodataframe.py", line 1399, in to_featureclass overwrite=overwrite, skip_invalid=skip_invalid) File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\features\_data\geodataset\io\fileops.py", line 583, in to_featureclass raise Exception("Invalid row detected at index: %s" % index) Exception: Invalid row detected at index: 0 If i open the file created ( no records) the second column is missing ? and an Id column has been inserted any ideas ? I've made sure no fields are blank,null or None , I've tried renaming the columns Update: I Read in a Shapefile and tried to write it back to a new shapefile in a different folder with a different name and it gives the same error
... View more
01-11-2019
04:19 AM
|
0
|
5
|
2913
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 02-20-2020 07:33 AM | |
| 1 | 07-22-2019 07:42 AM | |
| 1 | 01-18-2019 04:07 AM | |
| 3 | 01-16-2019 07:50 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|