Questions tagged [python]
Python is an open source interpreted programming language used in many GIS programs.
12,256 questions
143
votes
5
answers
30k
views
Accessing ArcObjects from Python
I would like to be able to script some things that are not exposed via arcgisscripting or ArcPy.
How do I access ArcObjects from Python?
102
votes
27
answers
173k
views
Python GDAL package missing header file when installing via pip
I asked this question on Stack Overflow before I realised this site existed. As this site it more appropriate, I'll ask it here too.
I'm trying to install gdal from pip pip install gdal inside a ...
98
votes
10
answers
257k
views
Converting projected coordinates to lat/lon using Python
This site returns
Point:
X: -11705274.6374
Y: 4826473.6922
when you search with the first key value of 000090, as an example. I assume that this is a spatial reference.
I am looking for instructions, ...
80
votes
3
answers
124k
views
Converting Pandas DataFrame to GeoDataFrame
This seems like a simple enough question, but I can't figure out how to convert a Pandas DataFrame to a GeoDataFrame for a spatial join?
Here is an example of what my data looks like using df.head():
...
78
votes
12
answers
18k
views
Alternatives to using ArcPy
I seem to use ESRI's ArcPy site package for virtually all of my Python geoprocessing. To ESRI's credit, these are an incredible suite of tools that can help accomplish a great deal. However, I would ...
74
votes
9
answers
86k
views
Finding nearest point in other GeoDataFrame using GeoPandas
I've got two geodataframes:
import geopandas as gpd
from shapely.geometry import Point
gpd1 = gpd.GeoDataFrame([['John',1,Point(1,1)],['Smith',1,Point(2,2)],['Soap',1,Point(0,2)]],columns=['Name','ID'...
70
votes
2
answers
236k
views
Reading shapefile in Python [closed]
My question is an extension of Vertical lines in a polygon shapefile.
There you will see a method of generating vertical lines with respect to the bounding box, at user-defined spacing. I understand ...
59
votes
6
answers
88k
views
Calling gdal_translate from Python code
Is it possible to use some gdal API to call gdal_translate from Python code?
I do not mean simply executing the gdal_translate.exe from the file system, but rather call it somehow in code so I do not ...
58
votes
3
answers
64k
views
Transforming Shapely Polygon and MultiPolygon objects
Is there an easy way of transforming Shapely objects (namely, Polygons and MultiPolygons) from one projection to another without having to dig around and extract coordinates by hand?
In fact, I don'...
55
votes
3
answers
32k
views
Smoothing polygons in contour map?
Here is a contour map for which all the polygons of levels are available.
Let ask how to smooth the polygons keeping all vertices preserved in their exact locations?
Indeed the contour is made on ...
49
votes
17
answers
37k
views
Learning Python programming with generic GIS goals in mind?
In your opinion, what is the best book/site to learn Python with GIS goals in mind?
By "best", I mean:
not very long (book)
easy to understand (book/site)
good practical examples (book/site)
For ...
45
votes
7
answers
67k
views
How to get raster corner coordinates using Python GDAL bindings?
Is there a way to get the corner coordinates (in degrees lat/long) from a raster file using gdal's Python bindings?
A few searches online have convinced me that there is not, so I have developed a ...
45
votes
2
answers
62k
views
Joining (concat) list of similar dataframes in geopandas?
I have a list of dataframes, all of the same structure and all are polygons.
How can I add them all together using geopandas?
43
votes
5
answers
73k
views
Writing numpy array to raster file
I'm new to GIS.
I have some code that converts infrared images of Mars into thermal inertia maps, which are then stored as 2D numpy arrays. I've been saving these maps as hdf5 files but I'd really ...
43
votes
3
answers
30k
views
Is it possible to look at the contents of Shapefile using Python without an ArcMap license?
I wondered if it is possible to look at the contents of a shapefile using Python without having and ArcMap license. The situation is that you can create shapefiles from many different applications, ...