POST
|
Hi Gavin, Yes, you are correct. I was aware of the DynamicMapLayer, but I didn't see the ability to control the image server output. The solution was to edit the `dynamicLayers` options, specifically `drawingInfo` ``` dynamicMapLayer.setDynamicLayers([{ ... "drawingInfo": { ... } }]); ``` And for anyone else trying to get more information on what ` drawingInfo` syntax looks like you can refer the Web Map Specification drawingInfo | ArcGIS for Developers Maybe I will create a Pull Request to add an example to the ESRI Leaflet Repo. Do you accept Pull Requests?
... View more
10-31-2019
08:54 AM
|
0
|
0
|
55
|
POST
|
I was wondering if there is any plans to incorporate MapImageLayers into Esri Leaflet. In theory, it would seem possible since according to the docs ' MapImageLayer processing is handled by the server, not the client.' I know that the 'Dynamic Map Layer' does many similar things, but the ' MapImageLayer' in Esri Js API 4.x seems to be significantly more powerful. Specifically, I love the 'renderer' and 'definitionExpression' in the ' MapImageLayer' 4.x functionality, which I can't find equivalents for in the 'Dynamic Map Layer'. Any chance this could end up in Esri Leaflet?
... View more
08-20-2019
01:25 PM
|
0
|
2
|
281
|
POST
|
In case anyone else tries to do the same, it turned out to be easier to simply update / add / delete using the edit_features functionality as described in the following ESRI guides: updating_features_in_a_feature_layer | ArcGIS for Developers and Editing Features | ArcGIS for Developers Kind of a bummer because I need to manage all the data updates individually instead of simply rewriting, but this solution is definitely the most efficient.
... View more
12-06-2018
02:31 PM
|
1
|
1
|
91
|
POST
|
I am trying to update / overwrite a Feature Layer using the ArcGIS API for Python. I am currently loading and manipulating the data in a SpatialDataFrame and I have published the data using `sdf.spatial.to_featurelayer()`. This function creates a shapefile and the resulting Feature Layer. However, the data is going to be updating and changing on maybe a weekly basis. I could delete the layer and simply recreate it, but there is a good chance that the layer will be part of a StoryMap or some other AGOL web map, so that is not an option. There is a good tutorial on how to overwrite a Feature Layer using pandas and a CSV here: overwriting_feature_layers | ArcGIS for Developers , but this depends on having the data in CSV format and utilizes the pandas `read_csv()` method, which does not have read_shapefile() equivalent. The `manager.overwrite()` method does not accept SDF format (though that would be super cool), so I think the best way to do it is probably updating the underlying shapefile and then overwriting from there. Any ideas on how to do that or any other ideas?
... View more
11-27-2018
08:51 AM
|
0
|
2
|
653
|
POST
|
After trying the geojson solution, I am falling back to using shapely and the from_shapely custom method which I took from Joel McCune. The geojson route ended up also being slow and having lots of geometry errors anyway, so I would need to do some geometry updates either way, so sticking with the "hack". I have posted an idea in ESRI Ideas to encourage a loads method similar to the one I am using from shapely. Thanks to Per for above recommendations.
... View more
11-02-2018
09:50 AM
|
0
|
0
|
265
|
IDEA
|
Currently in the ArcGIS Python API (from what I can tell) there is no geometry function which loads text from WKT format into ESRI geometry format. The closest thing that I can find is loads_xy method which handles point x, y data. But there is nothing for lines, polygons or multipolygons. As a work around I am currently using the shapely function loads and then converting back to ESRI format as I have documented in this geonet thread
... View more
11-02-2018
09:45 AM
|
2
|
0
|
251
|
POST
|
Yeah, I this is the best solution. It is unfortunate that there does not seem to be a solution where geometries can be created in ESRI format using the spatial data frame only, but this is a fast solution, once you have the geojson. Thanks, Nat
... View more
11-01-2018
10:10 AM
|
0
|
0
|
265
|
POST
|
Hi Per, Yes, that would work if I were using points, which I know is what I used in the example. However, the meat and potatoes of the data that i am dealing with is polygon. I basically need something like the from_xy function for polygons, multipolygons and lines as well.
... View more
10-30-2018
05:10 PM
|
0
|
2
|
265
|
POST
|
Update: I have been able to find a work around by following the post by Joel McCune here , by first converting the PostGIS text as shapely, then converting the shapely geometry as ArcGIS geometry format, which is pretty hacky. I am sure there is a function that convert PostGIS text / json outputs into ArcGIS geometry. Any ideas? Also weird, after running the conversion the correct geometry format, I can run set_geometry on the geom column, publish a feature_layer to AGOL, but I cannot plot on a map within Jupyter Notebook. I get the Exception : Spatial column not defined, please use `set_geometry` Even though I have run the method 2 lines above. ¯\_(ツ)_/¯ Full code here: from shapely.wkt import loads from arcgis.geometry import Geometry from arcgis.geometry import BaseGeometry @classmethod def from_shapely(cls, shapely_geometry): return cls(shapely_geometry.__geo_interface__) BaseGeometry.from_shapely = from_shapely conn = config.conn df = pd.read_sql("select id, ST_AsText(geom) AS geometry from ch01.sweet_table where group_id = 1", con=conn) df['geometry'] = df['geometry'].apply(lambda x: loads(x)) df['geometry'] = df['geometry'].apply(lambda x: Geometry.from_shapely(x)) Geometry(df.iloc[0].geometry).is_valid sdf = df.set_geometry('geometry') Geometry(sdf.iloc[0].geometry).is_valid #test geometry is valid sdf.spatial.plot(map_widget=m) #plotting error new_lyr_item = sdf.spatial.to_featurelayer('Tester Pester') published_item = new_lyr_item.publish()
... View more
10-29-2018
09:18 AM
|
0
|
4
|
265
|
POST
|
I am trying to 1. connect to a PostGIS database 2. Create a Spatially Enabled Data Frame 3. Export out to a feature layer 4. Push to AGOL. Of those steps, I have succeeded at number one, but I am getting a error in the process of setting a geometry column in the DataFrame. I have the function `set_geomerty()` does not like the format of the data that i am putting in, which has been text and shapely format. Is there an ESRI specific format that i should be using or a function that can put the geometry into that format? IDE: Jupyter Notebook python: 3.6 ArcGIS Python Api: 1.5.0 import pandas as pd from shapely.wkt import loads conn = config.conn df = pd.read_sql("select id, ST_AsText(geom) AS geometry from table where group_id = 63 limit 1", con=conn) df['geometry'] = df['geometry'].apply(lambda x: loads(x)) sdf = df.set_geometry('geometry') bmp_id geometry 0 Lot_5_78 POINT (-121.799248349 36.6987788232) ~/.virtualenv/esri/lib/python3.6/site-packages/arcgis/features/_data/geodataset/geodataframe.py in set_geometry(self, col, drop, inplace, sr) 1799 # Check that we are using a listlike of geometries 1800 if not all(isinstance(item, GEOM_TYPES) or not item for item in level): -> 1801 raise TypeError("Input geometry column must contain valid geometry objects.") 1802 #if isinstance(frame[geo_column_name], pd.Series): 1803 # frame[geo_column_name] = GeoSeries(frame[geo_column_name]) TypeError: Input geometry column must contain valid geometry objects. Gracias
... View more
10-26-2018
09:10 AM
|
0
|
6
|
1538
|
Online Status |
Offline
|
Date Last Visited |
4 weeks ago
|