91
votes
Uninstalling QGIS that was installed using OSGeo
Just to elaborate on the comment on the above answer that It appears that the uninstall option no longer exists in the osgeo4w.exe installer. As of today, there is an option to uninstall but you have ...
48
votes
Accepted
What is OSGeo4W?
OSGeo:
OSGeo is an umbrella organisation (Foundation) that supports many Open Source GIS Projects. Some of the more well known ones are: QGIS, GeoServer, and OpenLayers.
Being part of OSGeo gives a ...
16
votes
Accepted
Differences between OSGEO GDAL and GDAL python bindings?
As documented in https://pypi.org/project/GDAL/ plain "gdal" is deprecated and you should not use that for writing any new code
Additionally, there are five compatibility modules that are ...
12
votes
Uninstalling QGIS that was installed using OSGeo
Might add to the above entries with my current complete-removal workflow:
Delete C:\OSgeo4w64
Delete C:\ProgramData\Microsoft\Windows\Start Menu\Programs\OSGeo4W
Delete C:\Users\%USER%\documents\...
11
votes
Accepted
Crop a raster using rasterio and geopandas
The issue is resolved. The issue was I misread the documentation. On a second read, the rasterio.mask documentation clearly states that polygons should be a list of GeoJSON-like dicts. I found the ...
10
votes
Accepted
How do I install the GDAL bindings for C#/.NET 4.5.1?
Get the package from NuGet and then you need to call static methodGdalConfiguration.ConfigureGdal() from GdalConfiguration.cs/vb at startup to set process environmental variables. Call ...
9
votes
What is OSGeo4W?
Look at the OSGeo: Open Source Geospatial Foundation site. You will see that they support Desktop applications (GRASS GIS, QGIS,...), Web Mapping projects (OpenLayers, GeoServer,MapServer ...), ...
9
votes
Accepted
GDAL Python cut geotiff image
To cut an image (tif file) by using GDAL python library, and without gdalwarp utility, you need to find row and column raster indexes of top point [p1=(minX, maxY)] and bottom point [p2=(maxX, minY)]. ...
9
votes
QGIS 3.0 can't load plugin processing, no module named 'osgeo', on Manjaro Linux
Install the python missing module:
yaourt -S python-gdal
Then install the pip package:
pacman -S python-pip
and install the missing modules using:
pip install MissingModuleName
8
votes
No module named 'osgeo'
Try this,
pip install --global-option=build_ext --global-option="-I/usr/include/gdal" GDAL==`gdal-config --version`
7
votes
Accepted
Running script over every file in folder using GDAL in Python?
The python module glob is used to get all file names according to the pattern that you give it. The documentation for glob can be found here.
Within your script you would use glob like this:
...
7
votes
7
votes
GDAL/OGR Geometry Type Python
It's possible to get the layer geometry type without reading a feature.
ds = ogr.Open(your_input_file)
layer = ds.GetLayer()
layer_defn = layer.GetLayerDefn()
ogr.GeometryTypeToName(layer_defn....
7
votes
How to extract FileGDB's domains without ArcGIS?
I found a perfect answer for my question in a post I found in Alex Tereshenkov's blog. The post contains a python script for printing the FGDB's domains in python interpreter:
from __future__ import ...
6
votes
Accepted
No module named 'osgeo'
This sounds like you have multiple python installations, and GDAL is installed on one and not the other.
Try the following (which I have based upon this). Create a text file within your python ...
6
votes
Accepted
GDAL/OGR Geometry Type Python
I don´t want to be punctilious with the code, but you don´t need to loop all the features, the shapefile always store only one geometry type:
# get the data layer
layer = datasource....
6
votes
Docker container for OSGeo
There is a fairly large list of OSGeo Docker images here that are built on a variety of different base images. The page also contains information on the source, whether or not the image is on Docker ...
5
votes
ogr2ogr add geometry from x y when importing to postgis
If the data is now in your database you can use ST_MakePoint or ST_GeomFromText to construct a geometry object from your x and y columns, e.g.:
--ST_SetSRID is also used here as ST_MakePoint will ...
5
votes
GDAL/OGR Geometry Type Python
I solved the problem as such:
def geom_type():
shapefile_location = r"E:\Cameron\Python\GDAL\SHP\Cadastral_Parcels\Parcels.shp"
shapefile = ogr.Open(shapefile_location)
...
5
votes
Accepted
Python 3.6 error import osgeo
I solved this problem by installing via Python PIP pygdal package.
Firstly you need to check Gdal version installed on the machine, and install proper pygdal.
$ gdalinfo --version
GDAL 2.1.3, ...
5
votes
pyQGIS 3.0 script not running with processing import
I tested your code and stripped the problem down to the paths you are using. The error seems to be the forward slashes (/) that confuse your windows python installation. You should use backslashes on ...
5
votes
Missing osgeo in QGIS 3.4 Madeira (macOS High Sierra)
I had the same problem and solved it by:
removing both /Library/Frameworks/GDAL.framework and
/Library/Frameworks/GEOS.framework
downloading the old QGIS 3.0 installer from here
and installing only ...
5
votes
Accepted
Open .tiff, set projection, then re-save in Python with GDAL
You need to open the second file in update mode, then dereference it to save and close it.
roads = gdal.Open('road_lines.tiff', gdal.GA_Update)
roads.SetProjection(prj)
del roads # save, close
...
5
votes
Accepted
How to extract FileGDB's domains without ArcGIS?
Domains will be supported in GDAL 3.3 and they are already available in the current development version (the "main" branch). See https://gdal.org/drivers/vector/openfilegdb.html#vector-...
5
votes
Accepted
Setting Config Options for GDAL using Python
Use the API rather than starting up a subprocess:
gdal.SetConfigOption('GTIFF_REPORT_COMPD_CS', 'YES')
print(gdal.Info(r'C:\users\mikel\GeoData\DSM.tif'))
Works for me with my data.
5
votes
Accepted
Export list of shapely.geometry.polygons as Esri shapefile
You can easily save them to a shapefile using geopandas.
import geopandas as gpd
from shapely.geometry import Polygon
# polygons sample
polygons = [Polygon([(0, 0), (1, 1), (1, 0)]),
...
4
votes
Accepted
Why is the first element of my WFS layer None instead of a feature?
You weren't requesting the first feature, you were requesting a feature with an FID of "0" and your WFS doesn't have a feature with an FID of "0".
Why:
The ogr.Layer.__getitem__ method which allows ...
4
votes
Need File Geodatabase (*.gdb) read/write support in QGIS?
I see this:
and my options in the OSGeo4W Setup ('advanced install') that are probably relevant were:
4
votes
Accepted
Plot a surface with a DEM and mplot3d
1) In the first case, we have only the points and we need to construct a grid (regular or irregular) by interpolation.
2) In the second case, the raster is already a grid (regular) but Matplotlib ...
4
votes
Clipping GeoTIFF file by GeoJSON?
1)
I just don't know how to convert .geojson file to .shp.
This is a one of the bases of ogr Python. If you have a geometry, it is very easy to convert it to a shapefile
# geojson is GeoJson ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
osgeo × 236python × 124
gdal × 123
ogr × 42
qgis × 30
installation × 19
coordinate-system × 17
osgeo4w × 14
geotiff-tiff × 12
raster × 11
shapefile × 11
gdalwarp × 8
postgis × 7
pyqgis × 7
geojson × 6
arcpy × 5
openstreetmap × 5
geopandas × 5
open-source-gis × 5
gdal-translate × 5
python-3 × 5
qgis-3 × 4
c# × 4
ogr2ogr × 4
file-geodatabase × 4