Tag Info

Hot answers tagged

5

OGR has its own idiom for stdin, /vsistdin/. Use that as ogr2ogr's first argument (the dst_datasource_name) and you can pipe curl's output to it: curl "https://raw.githubusercontent.com/nvkelso/natural-earth-vector/master/geojson/ne_50m_admin_0_countries.geojson" | ogr2ogr -f "KML" countries.kml /vsistdin/


5

Sure you can use the No Data value in gdal_translate -a_nodata value: Assign a specified nodata value to output bands. Starting with GDAL 1.8.0, can be set to none to avoid setting a nodata value to the output file if one exists for the source file. or in gdal_cac.py use the less than (<) or greater than (>) or equals (=) commands. For example, below ...


4

[Edited] If your feature classes are saved as *.shp, you could try: ogr2ogr -f "FileGDB" mygdb.gdb ~/PathTo/MyFeatureClass.shp -lco FEATURE_DATASET=my_features However, since you are exporting from PostGIS another approach could be something like this: ogr2ogr -f "FileGDB" mygdb.gdb PG:"host=my_host user=my_user_name dbname=my_db_name ...


3

For the first part of your question: GDAL can guess the format of the input file from the file extension. The output format is defined by the -f option. If it is missing, Geotiff is assumed, but you get that warning if the file extension is not .tif. For a .grd output, you can select between GS7BG (rw+v): Golden Software 7 Binary Grid (.grd) GSAG (rwv): ...


2

GDAL does not recognize the file as ERDAS imagine, as promised by the extension .img. But it looks only at the file extension, and does no further investigation on the content of the file. EDIT Comparing with other data from the site, they seem to provide unformatted raw binary. The mask should be 17347 lines by 40031 samples (columns) So I created an ...


2

I had the same problem. This should solve the bug (QGIS 2.6 under Windows): close QGIS using regedit.exe, search for "Plugin-GeoReferencer". This should point to a folder under \HKEY_CURRENT_USER\Software\QGIS\QGIS2\Plugins (optional: export a .reg version of the folder for back-up) delete the folder "Plugin-Georeferencer" restart QGIS. Georeferencer ...


2

The task could feel trivial by reading the gdalwarp documentation http://www.gdal.org/gdalwarp.html and GDAL AAIGrid -- Arc/Info ASCII Grid driver documentation http://www.gdal.org/frmt_various.html. The target pixel size is three times bigger than the native resolution 0.008333333333 degrees/pixel (not 1000 m/pixel, see the comments). gdalwarp -of AAIGrid ...


2

All of the vector formats supported by GDAL/OGR are listed here. With each driver, check out the creation options to control the output. These are passed to ogr2ogr using -dco and -lco flags. Good text-based output drivers include: CSV - be sure to use -lco GEOMETRY=AS_WKT to get the well-known text geometry GeoJSON GML KML LIBKML.


2

polygonize is not a segmentation algorithm, it is a region grouping algorithm (only group pixel that touch and have the exact same value), so there is no special operator. Basically here is what it does (probably optimized) : initialise region count at zero you run through all pixel assign a value of region count to the first pixel that you meet if ...


2

Here is some of my C++ code for working with triangles: Structures, in order to understand my code understanding these structures is necessary: struct CoPair // linked list of coordinates { long ID; float X; float Y; float Z; CoPair *NxtPt; }; struct Tri // linked list of triangles made from 3 CoPair { bool Active; CoPair *A; ...


2

For this, you need to create new ogr features and save them to the layer and not simply create geometries ( geom1.AddPoint(linkpoint[0],linkpoint[1]), feature1.SetGeometry(geom1)), with dataSource.SyncToDisk() at the end (SyncToDisk() might be helpful to ensure that a particular feature is flushed to disk but it is not necessary here, look at the script). # ...


2

You can use URLs as paths to OGR data sources, so you don't need curl or pipes. ogr2ogr -f KML countries.kml https://raw.githubusercontent.com/nvkelso/natural-earth-vector/master/geojson/ne_50m_admin_0_countries.geojson


1

The gdalbuildvrt program isn't the right tool for this task. It's for making virtual mosaics and multiband images. I suggest this approach: Define the domain in which you want results (geotransform, rows and columns). We used to call this a "canvas" back in the day. Warp (gdalwarp, nearest neighbor) your source TIFFs to that domain, producing TIFFs with ...


1

Your buffer distance is given in the units of your dataset. Your coordinate system is lon/lat geographic. Thus 0.01 = 0.01 decimal degrees. To be able to buffer by 1 km (1000 m) you need to reproject your dataset to a projected coordinate system which has units in metres. There are examples in the Python GDAL/OGR Cookbook of how to reproject layers and ...


1

I think it's the alpha band that's causing problems. To extract the data band: gdal_translate -of hfa -b 1 original.tif band1.img Then to warp: gdalwarp -of GTiff -s_srs epsg:4326 -t_srs epsg:3857 -co "tfw=yes" band1.img band1_warp.tif Gives an image: With GDALINFO > Driver: GTiff/GeoTIFF Files: D:\Testing\Tiff\band1_warp.tif > ...


1

If you don't need to stretch or rotate your raster, you can use the Shift tool (Data Management -> Projections and Transformations). Measure the offset in x and y, then run Shift incorporating these values. edit: this answer assumes ArcGIS, as listed in the original tags


1

You can use the osr module (part of the standard GDAL install, so it should come with your Python bindings) and do something like this: import osr import gdal inDS = gdal.open(r'c:\somedirectory\myRaster.tif') inSRS_wkt = inDS.GetProjection() # gives SRS in WKT inSRS_converter = osr.SpatialReference() # makes an empty spatial ref object ...


1

You can by using GDAL following this discussion on GDAL-dev mailing list. As stated in the mentioned topic, you need GDAL compiled with Spatialite support. An alternative is already provided on the forum at TopoJSON level by @mbostock


1

After finding the geopdf files, I get the same error message with GDAL 1.11.0 that was shipped with QGIS Chugiak, although gdalinfo --formats lists the pdf driver as rw. But it works with GDAL 1.11.1 shipped with QGIS Brighton, current OSGeo4W and the binaries from gisinternals. See also How to add Georeferenced PDF as layer to QGIS 2.0? for some bug ...


1

What you are looking for is Geographic Markup Language (GML). It is human readable and should maintain everything. -f gml in gdal / ogr. Do not overlook KML either. Both are human readable vector OGC standards supported in gdal / ogr. You can open both in text editors.


1

Euclidean Allocation The only tool I know of, that specifically supports Euclidean Allocation based on euclidean distance calculation is Whitebox (see also their Help section). Region Growing I don't know the exact problem you are working on, but my guess is you can also solve it with region growing - a process quite common in image segmentation and ...


1

I found that ArcGIS when creates the pyramids on a raster added in a data frame, by default sets 8 levels of pyramids. If in gdal I add 8 levels, then ArcGIS it doesn't ask me again if I want to create the pyramids. So the GDAL command is: gdaladdo -ro file.tif 2 4 8 16 32 64 128 256 --config COMPRESS_OVERVIEW LZW



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