New answers tagged ogr2ogr
In this other post, somebody mentions doing: sudo ln -s /usr/lib/libproj.so.0 /usr/lib/libproj.so Which absolutely fixed the same error (ERROR 6: Unable to load PROJ.4 library (libproj.so)) for me.
I'd check the following: first of all, I'd like to be sure that source data are OK, by comparing them with official/cadastral data I'd try to use the qgis openlayers plugin to check if the transformation to 3857/900913 works properly for both 23031 and 25831 Try to reproject using QGIS, just saving the shapefile with the target srid. If using QGIS works ...
Are you sure that the driver is implemented? I have no experience with node-gdal myself, but I don't see it in the list of bundled drivers. There is also an open issue concerning PostgreSQL support. Otherwise you might want to add a driver to the gdal.open() method, but as I said, I couldn't find it in the bundled drivers. I looked for the PG: string which ...
You should be able to just use the sql argument in ogr2ogr. For instance, with the following polygon Shapefile with two features and two attributes: $>ogrinfo -so -al polygon.shp INFO: Open of `polygon.shp' using driver `ESRI Shapefile' successful. Layer name: polygon Geometry: Polygon Feature Count: 2 Extent: (-1.206294, -0.828671) - (0.727273, ...
I got the same error so I show the errorlog from postgres and got this: ERROR: function addgeometrycolumn(unknown, unknown, unknown, integer, unknown, integer) is not unique at character 8 HINT: Could not choose a best candidate function. You might need to add explicit type casts. STATEMENT: SELECT ...
If QGIS asks you for a CRS, it does not write that information into the file. You have to save the data into a new file, then QGIS writes the CRS information into it. Alternatively, use gdal_translate -a_srs to assign the CRS to the output file. If you need a different projection, use gdalwarp -s_srs -t_srs to do both things in one step.
As mentioned by @AndreJ specifying the EPSG code makes it work. Specifically the following work: ogr2ogr -t_srs EPSG:4326 -s_srs EPSG:7421 ilot_2008_027_wgs84_2.shp ilot_2008_027.shp Alternatively, I was trying to use the qgis python API to do it all in python using qgis but could not get it to work.
NTF Lambert II has a towgs84 datum shift, but that is not included in the .prj file. The .prj file uses a different naming for the projection, so the EPSG code finder might fail. I assume QGIS assigns the correct EPSG code (maybe in the .qpj file), and makes a standard transformation from one EPSG code to another using full towgs84 parameters. You should ...
First generate a list of SUBURB (I use SOVEREIGNT because playing with Natural Earth Data) using OGR SQL function and output to CSV ogr2ogr -f CSV ne_10m_admin_0_countries.csv ne_10m_admin_0_countries.shp -sql "SELECT DISTINCT SOVEREIGNT FROM ne_10m_admin_0_countries" Avoid the first line (header with skip=1) and loop on the list of suburbs (SOVEREIGNT ...
To select a single feature class from a gdb, we query for all entities inside it: -sql "select * from FEATURE_CLASS_NAME" To generate a list of feature classes following your sample use nested FOR loops: @echo off for %%S in (01 02 03) do ( for %%F in (01 02 03) do ( echo ogr2ogr out.gdb in.gdb -sql "select * from Sec%%S_Frm%%F" ) ...
This works perfectly well when converting the GML to GeoJSON with ogr2ogr (which can also be used from inside QGIS). ogr2ogr -f GeoJSON geojson_test.geojson lcsd000a15g_e.gml Displays correctly and overlaps with the original GML file:
Top 50 recent answers are included