10

You don't need to create circles. The formula is derived from the ratio you mentioned. Use the following script. You can apply the other formulas easily. import geopandas as gpd from math import pi, sqrt def pp_compactness(geom): # Polsby-Popper p = geom.length a = geom.area return (4*pi*a)/(p*p) def s_compactness(geom): # Schwartzberg ...


6

I had the same exact problem. I fixed it by: Uninstalling Anaconda and reinstalling, making sure the "Add anaconda to PATH" option was ticked. Installing geopandas with conda install -c conda-forge geopandas Uninstalling GDAL with pip uninstall gdal Installing the GDAL wheels from https://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal (follow the instructions on ...


5

Because gdf["geometry"]) is a GeoSerie and gdf["geometry"][0] is a shapely geometry (the geometry column is a list of shapely geometries). The type of data data=gdf["geometry"] print(type(data)) <class 'geopandas.geoseries.GeoSeries'> data= gdf["geometry"][0] print(data) <class 'shapely.geometry.polygon....


5

I just tried to install ipyleaflet with Jupyter 5.2.3: conda install -c conda-forge ipyleaflet and also didn't get a map. I then tried registering the extension with: jupyter nbextension enable --py --sys-prefix ipyleaflet since this is mentioned after the install with pip section. After restarting the kernel, the map was now displayed. Is ...


4

Going from the Draw Control example you can add a callback to the Draw Control that will get passed the GeoJSON from the feature: from ipyleaflet import Map, basemaps, basemap_to_tiles, DrawControl watercolor = basemap_to_tiles(basemaps.Stamen.Watercolor) m = Map(layers=(watercolor, ), center=(50, 354), zoom=5) draw_control = DrawControl() draw_control....


4

If you are able to use Jupyter Notebook or Lab, I have made a "code editor simulator". Initially I made two ways of using it, one via folium and the other one via ipyleaflet, but I have been updating only the latter because it's the only one I actively use. It can be a little annoying to install, I haven't pulish that, but if you get to it, you can ...


3

Create a view of the excel table using Make table view Read the values row by row with da.SearchCursor With string format construct the input parameters strings Something like: import arcpy arcpy.MakeTableView_management(in_table=r'C:\GIS\data\testdata\excelfile123.xls\Sheet1$', out_view='tempview') with arcpy.da.SearchCursor('tempview', ['RegY', 'HunCal', '...


3

You can edit your scripts with any IDE you want as long as you include git into your workflow. All the scripts you see are based in git repositories (see GEE docs): The Scripts manager stores private, shared and example scripts in Git repositories hosted by Google. You can see an overview of all the repositories you have access to at https://earthengine....


3

One thing that looks wrong is tiles{0}. Try just tiles. If that works, then try tiles{s} for a small performance improvement. The other issue is the order of x, y and z in the tile URL. It should be {z}/{x}/{y}. Here is working code: from ipyleaflet import Map, TileLayer planet_tiles_url=("https://tiles.planet.com/basemaps/v1/planet-tiles/...


2

For the ee.Geometry.Point() constructor, the dimension ordering of the coord parameter is longitude,latitude (or x,y), rather than latitude,longitude. Once you reverse your parameters, you should see some resulting images in the filtered collection. Space_Set = ee.ImageCollection( L8.filterBounds(ee.Geometry.Point(lon, lat)) ) print('Number of images in ...


2

The tylere/docker-tmpnb-ee repository is not longer being maintained. Development has moved to https://github.com/gee-community/ee-jupyter-contrib


2

After doing some digging, the answer is within the documentation, but not on the main BuildVRT page: http://gdal.org/python/osgeo.gdal-module.html#BuildVRTOptions The answer to my above question is therefore to use the outputBounds argument, like so: options = gd.BuildVRTOptions(outputBounds=(xmin, ymin, xmax, ymax), separate=True) outds = gd.BuildVRT(...


2

This is how i got it to work on a new computer (i did not know of ArcGIS Package Manager when i did this): Install ArcGIS Pro (i use version 2.0.1) in a folder so the path have no whitespaces, for example C:\Program123\ArcGIS Start windows cmd prompt. Navigate to C:\Program123\ArcGIS\Pro\bin\Python\envs\arcgispro-py3 (using cd Program123 etc...) Execute the ...


2

This image has 5 bands. A simple RGB image has 3 bands, or 4 when it has the alpha band. So to process, it creates the empty Numpy.Dataset(x,y,z): img_b1 = np.zeros((ncol,nrow,nband),dtype=dtype) Then it populates the dataset and has to do it for every band (or z level). GetRasterBand only return one band each time.


2

The EE Python API has been updated, breaking backwards compatibility. This is the way you get the tile URL these days: def GetTileLayerUrl(ee_image_object): map_id = ee.Image(ee_image_object).getMapId() tile_fetcher = map_id['tile_fetcher'] return tile_fetcher.url_format


2

Your used matplotlib.pyplot.imshow() to show the first grayscale image, and rasterio.plot.show() for the second RGB one. Use show() to display the first grayscale image (Band 4), too; from rasterio.plot import show import matplotlib.pyplot as plt src=rasterio.open('14072020.tif') plt.figure(figsize=(20,10)) show(src.read(4), transform=src.transform, title=...


2

You're running into the same problem/answer here: Adding data using Python from ArcGIS Online/ArcGIS REST Services directory to a ArcMap MXD --just reversing the layers and the map technology. You're trying to use an arcpy thing and put that into a ArcGIS Python API map. Basically, the layer you're trying to add to your map is not something the Python API ...


2

I assume that all shapefiles include these attributes: ISO3, geometry, PA_DEF, STATUS_YR import os from glob import glob import geopandas as gpd # get list of .shp file names in shp_folder shp_folder = "folder_path" shp_files = glob.glob(shp_folder + "/*.shp") # OR create your own list of file names # shp_files = ['.../wdpa95_uk_terr.shp', '.../...


2

The error mentions there is a layer missing in the Sentinel Hub configuration you are using to perform a WMS request. See documentation on how to configure your account before using sentinelhub-py. If I guessed correctly your SH credentials, I have added a new configuration with the instance ID: "40575c18-d1b9-4a4a-MASKED" Go to Configuration ...


2

You could try to define visualization parameters and then make a new variable where you add the visualization. It would look something like this: var vis = { min: 0, max: 3000, bands:['B4','B3','B2'], }; var ffa_db_new = ffa_db.visualize(vis); And then you export the new variable ffa_db_new instead of the old one.


1

It turns out I had the different version of Gdal installed and that's why it did not work.


1

users.get in the Python API for AGOL requires the actual username in Portal or AGOL of one of you account members. While using "siteadmin" returns a result this is not the actual administrator of your AGOL account unless they have the username of "siteadmin". Provide a username for an account within your Portal or AGOL organization and provided that they ...


1

I presumed there would be an easy way to convert FeatureCollection to GeoJSON and load up as a layer in ipyleaflet but it is not straightforward. As far as I can see there is no direct way of doing this. However, as a workaround, you can get a download url to your FeatureCollection (JSON is in the options but it did not work for me but CSV did) and then read ...


1

Python functions can return multiple variables . These variables can be stored in variables directly. This is a unique property of Python , other programming languages such as C++ or Java do not support this by default. The valueerror: too many values to unpack occurs during a multiple-assignment where you either don't have enough objects to assign to the ...


1

The problem seems to be that the split() functions returns more value than the variables used on the left side of the = operator. I quickly tried the following code snippet: s = "./eopatches_sampled_Slovenia/" s.split("/") ['.', 'eopatches_sampled_Slovenia', ''] a,b = s.split("/") Traceback (most recent call last): File "&...


1

We have some clues here that may help you Using Anaconda modules from the ESRI python environment (So sad I am retired and now "unknown user")


1

Your call to getMapId() is done on the wrong object. Simply call it on your feature, with or without visualization params, like this: mapid = sri_lanka.getMapId()


1

There is an Ipython console(A kernel for Jupyter) for QGIS as a plugin, which you can add from QGIS official plugin repository or download from Github and copy to the plugin folder in QGIS. https://github.com/elpaso/qgis-ipythonconsole


1

It turns out I should use my IP address: http://192.168.99.100:8888/?token=.... Reference: https://www.reddit.com/r/docker/comments/a4gvnm/localhost_refused_to_connect/?utm_content=full_comments&utm_medium=message&utm_source=reddit&utm_name=frontpage


1

From the documentation: import arcsilib arcsilib.arcsirun.SomeArcsiTool(AnARCSIParamsObj)


Only top voted, non community-wiki answers of a minimum length are eligible