Questions tagged [python]

Python is an open source interpreted programming language used in many GIS programs.

Filter by
Sorted by
Tagged with
0
votes
1answer
34 views

GeoServer REST API for NetCDF in Python

I am trying to programmatically edit the dimension variable in GeoServer for 200+ NetCDF's. This is how I am trying it: from geoserver.catalog import Catalog cat = Catalog("http://localhost:8080/...
0
votes
1answer
21 views

Accessing Numpy Array found within an XArray from Satpy

dask.array<shape=(76, 76), dtype=float32, chunksize=(76, 76)> Coordinates: crs object +proj=utm +datum=WGS84 +ellps=WGS84 +no_defs +units=m +zone=33.0 +type=crs * y (y) float64 ...
-1
votes
0answers
19 views

Extracting pixel values from Earth Engine images

I'm trying to read the data point values that creates a given image from a dataset. I'm not interested in rendering visualisations, rather play with the number values behind each pixel. I hope this ...
2
votes
1answer
32 views

Parsing GeoJSON in Python?

I want to try and split a GeoJSON FeatureCollection into the individual features. So that the name of the file I write to is the "ED_ID" field. So far I can only read the JSON. I am new to python and ...
2
votes
1answer
39 views

How to dissolve overlapping polygons using GeoPandas

Assuming the following: from shapely.affinity import translate from shapely.geometry import Polygon import geopandas p0 = Polygon( [(0,0), (2,0), (2,2), (0,2)] ) p1 = translate(p0, xoff=1) p2 = ...
0
votes
0answers
32 views

Python gdal_translate move raster

I would like to translate from TIFF to ASCII, import os os.system("gdal_translate -of AAIGrid -a_srs EPSG:25830 " + 'my.tif' + " " + 'my.asc') But when I do that the ASCII file is moved: ASCII ...
0
votes
1answer
31 views

geopandas overlapping check

How we can check if feature has intersections or not with other features in one shapefile data, I wanna make sure if in that file there is no overlaps between polygon, I have read this approach "An ...
3
votes
1answer
253 views

Open source GIS web server

I am a proficient GIS and Python user. I would like to ask if any open source tools exist which allow for rendering of geospatial data on a website. I would prefer to avoid tools which require in-...
-1
votes
0answers
18 views

Satellite image analysis using sentinel in python

I am trying to download the map of certain region using Sentinal. I am using "BANDS-S2-L1C" to authenticate. When i try running an algorithm to fetch the data of the region, it is throwing "Server ...
0
votes
1answer
115 views

OSError: Could not find lib geos_c.dll

After a system re-imaging, I am seeing this error message when trying to run a script involving shapely: OSError: Could not find lib geos_c.dll or load any of its variants ['C:\\Users\\myusername\\...
0
votes
0answers
33 views

Error while performing an intersection of a point and a multipolygon

I'm willing to build a tiny service that given a point location, it searches within a multipolygon, which polygon object it is intersecting. My current development is defined as this: from osgeo ...
2
votes
0answers
43 views

Error on making a get request to a feature layer?

I am trying to query a feature layer from a script using the arcgis api for python: from arcgis.features import FeatureLayer lomr = FeatureLayer("https://hazards.fema.gov/gis/nfhl/rest/services/...
1
vote
2answers
95 views

Converting large data with lat and long into X and Y?

I have 9888562 records in dataframe and I would like to convert my lat, long to UTM x,y. according to my code, I have used pyproj package but because my data are too much it takes a long time and ...
3
votes
2answers
35 views

Working with memory ouputs in PyQGIS3

I have the following code snippet I run in QGIS 3.4 which goes through a list of shapefiles (my_wild) and runs a polygon to lines process. It performs the process and adds them to the map as expected, ...
0
votes
0answers
16 views

Using gdalwarp, how to first transform and then clip instead of vice-versa?

I have a large number of GeoTiffs that I need to clip by a polygon stored in a shapefile and then save them as a new raster. I use a gdalwarp command which I call from a Python script. These GTiffs (...
2
votes
0answers
15 views

GDAL osgeo for python treating Z dimension differently

I have a space defined by a polyhedral surface, and I would like to check if a point is inside this space, and I would like to do this in python with gdal. After trying the default installation of ...
1
vote
1answer
37 views

GDAL module in python error

I have some troubles with GDAL module on Python. When I try to import gdal, console displays this: Файл "c:/rstp/Lib/site-packages/osgeo/__init__.py", строка 48, из <module> __version__ = ...
1
vote
1answer
32 views

Show Leaflet markers that falls inside mapbounds, based on geocode location entered from database

I have a GUI application where data from my database are displayed on a table and also displayed as markers on Leaflet map. I have added the Geocode (L.Control.geocoder()) function into my application,...
2
votes
1answer
66 views

GeoPandas: Get distance from geom in tableA to a geom in tableB that matches attribute from tableA

UPDATE WITH SOLUTION (at bottom) Using GeoPandas I am trying to identify the distance between an election candidate's home address (Point) and the electoral district they are running in (Polygon). ...
1
vote
1answer
15 views

TopologicalError: The operation 'GEOSDifference_r' could not be performed

I'm trying some code to get the building footprints of Barcelona: import osmnx as ox import matplotlib.pyplot as plt %matplotlib inline place_name = "Barcelona, Barcelona, Catalonia, Spain" graph = ...
0
votes
0answers
12 views

Mimik -crop_to_cutline from gdalwarp with rasterio.mask

I'm trying to clip a raster with some polygons, some of them lie party outside of the raster. In gdalwarp, if you set -crop_to_cutline, it will fill the exterior part with no data and make it be a ...
1
vote
0answers
29 views

Multiplying two iterating rasters in ModelBuilder or Python?

I have several Landsat scenes that I wish to remove clouds from. I can do this by multiplying the Landsat layers by their associated cloud layers in the Raster Calculator. How can I set up iterations ...
1
vote
0answers
37 views

How to change the color of an specific area of a shapefile using Python?

I have this map and I need to emphasize with a different color some cities from this map: This is my code: import matplotlib.pyplot as plt import json import time import geopandas as gpd from ...
2
votes
1answer
50 views

How can I plot scatter plots over a shapefile using Python?

This is my code: import matplotlib.pyplot as plt import json import time import geopandas as gpd from descartes import PolygonPatch from shapely.geometry import LineString borough = gpd.read_file('...
2
votes
0answers
56 views

Calculate velocity and errors from distance between GPS points

I'm using a Kalman filter to track the position of a vehicle and for my measurement, I have a GPX file (WGS84 Format) containing information about the latitude, longitude, elevation and the timestamp ...
2
votes
1answer
40 views

Converting an AML into Python - terms not within help

I'm using an AML used for preprocessing required by the SPARROW model (https://www.usgs.gov/mission-areas/water-resources/science/sparrow-modeling-estimating-nutrient-sediment-and-dissolved?qt-...
0
votes
1answer
34 views

Defining variable for output location based on feature class attribute? [closed]

I'm pretty new to python. I have a feature class of points (Points_Layer) that covers the state and a feature class of municipal boundaries (Municipalities). My script is going to loop through each ...
2
votes
1answer
57 views

How to clip raster inside of circle (python gdal)

I have a source raster and an ERSI shape file, want to crop the raster into the circle. raster = gdal.Open("raster.tif", gdal.GA_ReadOnly) #read raster projection=raster.GetProjectionRef() ...
1
vote
1answer
60 views

Read RAT (raster attribute table) using GDAL or other python libraries?

Referring to this post, is there any update on the reason why GDAL function band.GetDefaultRAT() always returns NoneType? I can't find much documentation. I've tried to create a RAT for testing (...
0
votes
0answers
11 views

Can't run mapproxy server: SyntaxError: invalid syntax

I have successfully installed a MapProxy == 1.8.0. And I have set mapproxy-util create -t base-config gasps But when I run server, using mapproxy-util serve-develop mapproxy.yaml Console throws it: ...
2
votes
1answer
30 views

What data structure to use for raster data when using rasterio?

I want to write a method in Python that reads a raster (GTiff) using rasterio and returns its contents. Then, some processing is done. Finally, I want to write the data to a new GeoTiff. As far as I ...
3
votes
1answer
90 views

Convert contours to polygons maintaining attributes using Python?

I have a series of polylines(contours) that i want to convert to polygons using Python (GeoPandas, Fiona, Shapely). Because these are contours, there will be donut polygons, can anyone point me to how ...
2
votes
1answer
45 views

Accessing a ShapeFile with GoogleEarthEngine-API : Invalid GeoJSON geometry

I'm trying to download Sentinel-2 data of my area of interests on Google Earth Engine API for Python. I'm trying to access my shape file (contains 2 different polygons) on the API. I added the shape ...
1
vote
0answers
29 views

Check geometries in QGIS for multiple KML Files all at once in R or Python? [closed]

I am very new to GIS analysis so please bear with me. I have 2000 KML files. I am currently using QGIS Check Geometries function to generate the error report that consists of the following. A CSV ...
1
vote
1answer
47 views

Aligning rasters with Python (QGIS)

Does someone know if there is a SAGA or GDAL tool that is capable of aligning two raster layers? For the creation of a plugin I want to automate this process so the raster alignment option of QGIS ...
0
votes
1answer
42 views

Downloading NDVI time-series using python API

Are there examples of an API where I can pass a lat, lon, date-range and get NDVI time-series for that location based on Sentinel-2 data without having to download entire tiles and without having to ...
3
votes
1answer
109 views

How to change a numpy array's dimensions [closed]

I'm using GDAL Python API to read a raster into a NumPy array, it will return a array's shape like [bands, rows, cols], if we want to use OpencCV to deal with this array, it will cause some problem, ...
0
votes
0answers
36 views

Cannot open gdb folder from external drive using geopandas

I am trying to open a .gdb folder from an external drive with geopandas: import geopandas as gpd data = gpd.read_file('/Volumes/SSD/data.gdb') and I am getting the following error: DriverError: '/...
1
vote
1answer
16 views

Unable to activate analytic asset in satellite Imagery

I was trying to import the map of Melbourne. I was able to fetch the details from API coordinates but when i am trying to check the analytic asset status, it is returning inactive. # extract image ...
2
votes
0answers
46 views

Converting from .las to .ply and vice versa in Python? [closed]

I am trying to convert a .las/.laz file into .ply file, read the .ply file, do some processing on it and then convert it back to .las/.laz file. Is there any Python implementation for this? For ...
0
votes
1answer
47 views

Seeking Python API to assess accessibility to foodbank site?

The aim is to look at accessibility or lack thereof, in certain areas of the city, in order to inform future foodbank services. I have been working in Python/Spyder, and using OpenRouteService API to ...
0
votes
0answers
20 views

Permissions are blank when trying to load satellite images from Planet API

I am trying to download the map of Melbourne using Planet API. I have given AOI coordinates of Melbourne. When I run the code the permissions are returning blank ("_permissions": []). I cannot able to ...
1
vote
0answers
26 views

Comparing NDWI regions with a given shapefile Google Earth Engine Python?

With the code below, I computed the NDVI, NDWI and NDWIMOD indices of a R.O.I. in order to detect water areas in that R.O.I. Now, my goal concerns to compare the water areas with a given shapefile ...
1
vote
2answers
49 views

Error sending request to OpenRouteService API from a set of client addresses to a foodbank site

I am sending a request to OpenRouteService API from a set of client addresses to a foodbank site: I am passing coordinates in the form ((x1,x2),(y1,y2)) where x coordinates are from a large csv file, ...
3
votes
1answer
49 views

Accessing OGR driver options using OGR/GDAL in Python?

Using OGR in Python, I am attempting to modify the driver settings for S57. I am able to read the meta data from the driver as follows: import ogr driver = ogr.GetDriverByName("S57") driver....
2
votes
0answers
48 views

GeoPandas spatial join generates error in QGIS 3.8 Python console

I want to execute a spatial join using GeoPandas in the Python console QGIS 3.8 like this: dfsjoin = gpd.sjoin(point, polygon) but it doesn't work. It always shows the following error: Exception ...
1
vote
0answers
42 views

Writing Python list data into CSV file in multiple columns? [closed]

I am trying to write data into csv file from python list. I am using aws lambda for this...... My code fields = ['SnapshotId', 'StartDate'] csvio = io.StringIO() writer = csv.writer(csvio,delimiter=...
1
vote
0answers
19 views

Split .tif image in Python using GDAL

I am trying to split .tif image that i have downloaded from satellite imaginary. The .tif image is 114MB and has lot of data and i want to split the image into further small images to work more on the ...
3
votes
1answer
38 views

QGIS cannot import SciPy (QGIS 3.6 Noosa, Ubuntu 18.04, EnMapBox plugin)

I had been struggling to get QGIS installed because (currently) the ubuntugis repo seems to not be working well (couldn’t load Python at all). I got around that problem by installing QGIS using ...
1
vote
0answers
25 views

Fusing position data obtained from one coordinate system with other sensor position coordinates? [closed]

I'm using data from GPS and from vehicle sensors (Ultrasonic) separately to track the position of a vehicle using Kalman filter. I want to implement sensor fusion for the received measurement data and ...