Tag Info

New answers tagged

1

ogr2ogr **-F** MySQL MySQL:mapas,user=xxxx,password=xxxx \ -nln test -nlt MULTIPOLYGON \ -update -overwrite \ -lco ENGINE=MyISAM \ -lco MYSQL_FID=ogr_fid -lco GEOMETRY_NAME=geometry \ /Users/Seph/Downloads/TM_WORLD_BORDERS-0.3/TM_WORLD_BORDERS-0.3.shp The letter f has to be capitalized. regards


0

OK, so it turns out that R'ing TFD yields the right way to do this, eventually - so long as you cast a wide net in your search for TFD. first: use ogr to open, not mapnik. (ogr has been import-ed at the start of the file)... l = [] # initialise vector of LGA codes ds = ogr.Open('BH.TAB') Then take advantage of the fact (mentioned here ...


0

I found the solution. The error was that I didn't set GDAL_DATA environment variable: ERROR 4: Unable to open EPSG support file gcs.csv. Try setting the GDAL_DATA environment variable to point to the directory containing EPSG csv files. I managed environment variables in Windows and the command works right. Thanks four your help!!


2

If you are using Linux, you should be able to connect to a WFS server, and fetch a layer without any problem with wget. I was able to fetch a dataset consisting of 10209 features, which was 33.3 MB in size. My test command was the following: wget -O output.gml ...


2

For the first command line, you moved to the folder where the shapefiles are. You have to do the same for the second command line. My sample command line looks like: for %%N in (D:\Karten\gdal\ogr2ogr\*.csv) DO ogr2ogr D:\Karten\gdal\ogr2ogr\%%~nN.shp %%N pause giving full path for in and destination file. Update Testing your batch, it fails for me ...


2

You could try the OGR WFS option "-dsco OGR_WFS_PAGING_ALLOWED=ON" as described in the docs http://www.gdal.org/drv_wfs.html


2

With your VRT file GDAL tries to find layers "temperature" and "elevation" from the target databases. Either use the original layer names in VRT in OGRVRTLayer name: "rice_temp" and "rice_elev", of rename them with SrcLayer <OGRVRTDataSource> <OGRVRTLayer name="temperature"> <SrcDataSource>rice_temperature.sqlite</SrcDataSource> ...


2

You are only inspecting osm_id field. It seems you didn't inspect your multipolygons table. On a local use case, I do : ogrinfo -so france.simple.spatialite multipolygons It returns FID Column = OGC_FID Geometry Column = GEOMETRY osm_id: String (0.0) osm_way_id: String (0.0) name: String (0.0) type: String (0.0) ... So the identifiers are not only ...


1

I am not sure if GDAL is recognizing that the projection is just EPSG:3857 by the code but I suppose that the projection info it finds is correct. Make the same test with ogrinfo. If you can't get the same info with C# then there may be something wrong in the bindings or in your code. ogr2ogr -f "ESRI Shapefile" -s_srs epsg:4326 -t_srs epsg:3857 ...


1

For this special purpose you can use the ogrtindex tool http://gdal.org/ogrtindex.html. The tool is made for creating footprints of vector datasets to be used as a tileindex file with MapServer http://www.mapserver.org/optimization/tileindex.html. Nonetheless, the tool makes exactly what you want even without MapServer. Another, more general option would be ...


0

One way to approach this would be using Rasters. Raster operations would be faster and more reliable in this case. Convert your vector layers to rasters using Raster -> Conversion -> Rasterize. (Start with a large pixel size to test your approach.) Subtract the rasters using Raster Calculator. convert the result into Vector using Raster -> Conversion -> ...


0

I was able to resolve this by doing a series of difference queries based on a few shape files I have. Still found not great automated way but it's done nonetheless.


2

What you are looking for is essentially an upsert (albeit without the update part). This is not part of ogr2ogr and is fairly complicated to implement in Postgres, see the docs, for more information than you would ever want to know about upserts. A simple alternative, would be to use a temp table to insert into from ogr2ogr and then run an insert for only ...


2

If you happen to work in R, you can use the vec2dtransf package (which is mine :) ). You would simply need to load your Shapefiles into R using rgdal and define your affine transformation to apply it on the data. After such process, you can export your data to a transformed Shapefile also via rgdal. In vec2dtransf, affine transformations can be defined from ...



Top 50 recent answers are included