The problem is not in encoding.
The problem is in the data because it seems that in some row of your table there is a value "20A" in a field that it defined to be of type integer. GDAL is telling that it can't save string '20A' as integer into shapefile so it saves just the number part "20".
GeoPackage is a SQLite database and for SQLite it is not a ...
Ok so I figured it out while looking up metadata for @Ian Turton (Comments section). He was right, it's the elevation.
Number 38 in the dxf specification refers to the elevation.
38 DXF: entity's elevation if nonzero
Source : https://images.autodesk.com/adsk/files/autocad_2012_pdf_dxf-reference_enu.pdf
It seems to work with this syntax
ogrinfo wfs:https://www.mercator.vlaanderen.be/raadpleegdienstenmercatorpubliek/wfs anb_insp:PS.ProtectedSite-birds
INFO: Open of `wfs:https://www.mercator.vlaanderen.be/raadpleegdienstenmercatorpubliek/wfs'
using driver `WFS' successful.
ABSTRACT=Publieke Download Service van Mercator
You need to separate
the "page" name from the parameters with a ? instead of a &
ogrinfo -al -so "https://www.mercator.vlaanderen.be/raadpleegdienstenmercatorpubliek/wfs?version=2.0.0&request=GetFeature&typeName=anb_insp:PS.ProtectedSite-birds&srsName=EPSG:31370"
ERROR 6: Update from remote service not supported
Had to open data source read-...
Try the following.
ogr2ogr --debug ON -sql "select top 100 * from table" -f "GPKG" -a_srs "EPSG:4269" test123.gpkg MSSQL:database=dbname;server=servername;trusted_connection=yes;GeometryFormat=native -nln nameinpackage
table not dbo.table in the sql query -> i have had issues when using prefixes randomly
trusted_connection=yes can be replaced with ...
To expand on Martin Jensen's answer, I set that environment variable in my shell which was invoking ogr2ogr, as well as setting PGCLIENTENCODING. Like so:
ogr2ogr -f "Postgresql" <PG conn string> <oracle conn string> ...
and now my encoding is working as expected. Without ...
ogr2ogr MSSQL Driver wants to read\create geometry_columns metadata table in you mssql database.
You can create table geometry_columns and add record for your table to it.
You can set config parameter MSSQLSPATIAL_USE_GEOMETRY_COLUMNS to NO
ogr2ogr --config MSSQLSPATIAL_USE_GEOMETRY_COLUMNS NO -f GPKG test.gpkg MSSQL:database=somedb;server=somesrv;...
From @ThingumaBob comment:
alias your PK column AS fid: ogr2ogr wants that identifier for GML, and it seems the driver will add that field in any case.
Aliasing the collumn I wanted as fid worked and no new attribute field was created when exporting to gml.
I guessed the SRS to EPSG:25832 (UTM 32N) by looking at the DXF file with QGIS.
ogr2ogr -f GeoJSON umweltzone.geojson Umweltzone-Neu-Ulm.dxf -limit 1 -s_srs EPSG:25832 -t_srs EPSG:4326
-f GeoJSON output format
umweltzone.geojson output file name
Umweltzone-Neu-Ulm.dxf input file name
-limit 1 output only one ...