Re: [gdal-dev] gdal_translate, exporting "Byte - Eight bit unsigned integer" single band tiff to gpkg using -ot Byte results in 4 bands raster with changed values

2020-12-02 Thread jratike80
It might be good to read also about the open options in https://gdal.org/drivers/raster/gpkg.html "BAND_COUNT=1/2/3/4: Number of bands of the dataset exposed after opening. Some conversions will be done when possible and implemented, but this might fail in some cases, depending on the BAND_COUNT v

Re: [gdal-dev] Converting OBJ to Geojson files with ogr2ogr

2020-12-02 Thread Paul Harwood
Whatever works for you - although I can sense the purists going cross-eyed at the phrase "using Geojson as our internal coordinate system " :) I think you might be piling up problems for your self later - but then I don't know your scope. Good luck. PS - just to be clear "purist" is not meant to

Re: [gdal-dev] Converting OBJ to Geojson files with ogr2ogr

2020-12-02 Thread Brandon Biggs
Hello, We're using JavaScript, not Unity, but this is very interesting, I wish it was a JS package. We're kind of using Geojson as our internal coordinate system at the moment, but with a few oddities, like allowing 0.0 as the origin, rather than using Long lat. I just built a parser, so we're g

Re: [gdal-dev] gdal_translate, exporting "Byte - Eight bit unsigned integer" single band tiff to gpkg using -ot Byte results in 4 bands raster with changed values

2020-12-02 Thread Even Rouault
On mercredi 2 décembre 2020 15:16:44 CET Nicolas Cadieux wrote: > Hi, > > This follows a discussion in the qgis-user mailing list. We are using > gdal_translate (and QGIS "export as") on a 8bit unsigned single band > tiff to a .gpkg. When using no -ot switch or when using -ot Byte, this > result

Re: [gdal-dev] Converting OBJ to Geojson files with ogr2ogr

2020-12-02 Thread Paul Harwood
GeoJSON is very good for many things but I would not convert an .OBJ to GeoJSON and then into the VR space local coordinate system. You are going to have project the OBJ into 4326 and then project it again into the local coordinate system - even if implicitly. Go directly from OBJ to an internal me

[gdal-dev] gdal_translate, exporting "Byte - Eight bit unsigned integer" single band tiff to gpkg using -ot Byte results in 4 bands raster with changed values

2020-12-02 Thread Nicolas Cadieux
Hi, This follows a discussion in the qgis-user mailing list.  We are using gdal_translate (and QGIS "export as") on a 8bit unsigned single band tiff to a .gpkg.  When using no -ot switch or when using -ot Byte, this results in a 4 band .gpkg raster with the wrong values.  (Values in band 1 to

[gdal-dev] ogr2ogr project/transform CRS in the same database table

2020-12-02 Thread Mark Johnson
See MSSQLSpatial - Microsoft SQL Server Spatial Database — GDAL documentation https://gdal.org/drivers/vector/mssqlspatial.html The MS SQL Spatial driver passes SQL statements directly to MS SQL by default, rather than evaluating them internally when using the ExecuteSQL() call on the OGRDataSour

Re: [gdal-dev] Converting OBJ to Geojson files with ogr2ogr

2020-12-02 Thread Brandon Biggs
Hello, It's for a custom coordinate system for VR. Geojson provides a very easy syntax for properties and geometries that I like to use with origin at 0,0 bottom left. I'll probably write my own converter, as OBJ is kind of an important file type we need to support. Thanks, Brandon Biggs

Re: [gdal-dev] gdal_create: input file option

2020-12-02 Thread jratike80
Hi, Great, allowing to override all automatically captured parameters is probably a good feature. I believe that some users will find this new option useful. Next challenge could be to burn vertical and horizontal gridlines for warping and resampling tests. -Jukka- Even Rouault-2 wrote > On m

[gdal-dev] Transformation works in GDAL2 but cause problems in GDAL3

2020-12-02 Thread mattijn
Dear all, Question: how do I define my source raster instance, to avoid using the advance `-ct` operator in gdalwarp in GDAL3 during reprojection? I've been reading https://trac.osgeo.org/gdal/wiki/rfc73_proj6_wkt2_srsbarn#Axisorderissues and https://rgdal.r-forge.r-project.org/articles/CRS_proj

[gdal-dev] Creating a MVT cache with ogr2ogr but using the EPSG:25830 CRS...

2020-12-02 Thread A Huarte
Hi everyone, I would create a Mapbox Vector Tile cache using ogr2ogr and MVT: Mapbox Vector Tiles — GDAL documentation but writing the files in the EPSG:25830 projection. Later I want to show this layer in one OpenLayers map viewer with this CRS as map system reference. I have read the driver pr

Re: [gdal-dev] [EXTERNAL] Re: Converting OBJ to Geojson files with ogr2ogr

2020-12-02 Thread Paul Harwood
I guess the OP can answer for themselves but I am curious since I cannot see anyway that Cityxxx would facilitate the conversion of an .obj into GeoJSON ? On Wed, 2 Dec 2020 at 12:49, Clay, Bruce wrote: > Take a look at CityXml / CityGml and CityJson. There is partial support > at least in GDAL

Re: [gdal-dev] [EXTERNAL] Re: Converting OBJ to Geojson files with ogr2ogr

2020-12-02 Thread Clay, Bruce
Take a look at CityXml / CityGml and CityJson. There is partial support at least in GDAL based on web searches. Also some support for QGIS through a plugin Bruce From: gdal-dev on behalf of Paul Harwood Sent: Wednesday, December 2, 2020 5:31 AM To: Andrew

Re: [gdal-dev] ogr2ogr project/transform CRS in the same database table

2020-12-02 Thread Hector muro
Hi, Thanks for that. The first query returns: sqlite_version() (String) = 3.7.17 The latter returns an error (no such function: spatialite_version), so I gess my gdal installation is not set with Spatialite, but if I do this: ogrinfo --formats | grep -i spatialite SQLite -vector- (rw+v): SQ

Re: [gdal-dev] ogr2ogr project/transform CRS in the same database table

2020-12-02 Thread Rahkonen Jukka (MML)
Hi, Hi, What do you get from ogrinfo by having -sql "select sqlite_version()" and -sql "select spatialite_version()" If the first query returns something like sqlite_version() (String) = 3.24.0 it confirms that you are really running SQLite. It the latter command does not return anything it mea

Re: [gdal-dev] ogr2ogr project/transform CRS in the same database table

2020-12-02 Thread Hector muro
Hi again, Okey, I think I got it. And you were right, it was getting the quotes correctly. I needed to single quote the 'Schema.Table'. Now the error says that there is no such function "ST_Transform" when using sqlite dialect!! ogrinfo "$connect_string" -dialect sqlite -sql "update 'XXX.xxx' se

Re: [gdal-dev] ogr2ogr project/transform CRS in the same database table

2020-12-02 Thread Hector muro
Hi, Yeah, indirect_sqlite returns the same as using no dialect. And if I use the dialect sqlite with the top function I get a syntax error; ERROR 1: In ExecuteSQL(): sqlite3_prepare_v2(select top(1) * from xxx): near "from": syntax error Thanks for the effort, I appreciate it. I really did no

Re: [gdal-dev] ogr2ogr project/transform CRS in the same database table

2020-12-02 Thread Rahkonen Jukka (MML)
Hi, Try also with “-dialect indirect_sqlite” but it should not make difference in this case. Then I must give up, hopefully somebody who has access to SQL server can continue. Before that one more hint: If you do not define a dialect the you are using the native SQL server SQL dialect. SQL serv

Re: [gdal-dev] ogr2ogr project/transform CRS in the same database table

2020-12-02 Thread Hector muro
Hi, Sorry, no, I meant that, using the flag dialect returns an error of "Table not found", but using the -sql flag without dialect returns records for that table. Therefor I believe the "problem" is with the dialect, here: [dev@localhost ~]$ ogrinfo -dialect ogrsql -sql "select top(1) * from xxx

Re: [gdal-dev] ogr2ogr project/transform CRS in the same database table

2020-12-02 Thread Rahkonen Jukka (MML)
Hi, Sorry, I can’t follow what did you test. Do you mean that ogrinfo -dialect SQLite -sql "select * from crown_site_data limit 1" "$connect_string" returns just an error? And the same with ogrinfo -dialect SQLite -sql "select * from \"crown_site_data\" limit 1" "$connect_string" Try also with

Re: [gdal-dev] ogr2ogr project/transform CRS in the same database table

2020-12-02 Thread Hector muro
Hi, Yeah, I did try that, with the same result. the test with "sql" (no dialect) returns correct. ogrinfo -sql "select top(1) * from " "$connect_string" : [dev@localhost ~]$ ogrinfo -sql "select top(1) * from crown_site_data" "$connect_string" ERROR 1: Error initializing the metadata tables : [S

Re: [gdal-dev] Converting OBJ to Geojson files with ogr2ogr

2020-12-02 Thread Paul Harwood
.OBJ is a simple object mesh (or to put it in more traditional terms: TIN) - it has shape but no data values and is not geolocated. I don't think there is any driver for OGR that will read .OBJ. You are going to problems with geolocation if you write your own. Geojson requires that the geometrie

Re: [gdal-dev] ogr2ogr project/transform CRS in the same database table

2020-12-02 Thread Rahkonen Jukka (MML)
Hi, I am not familiar with SQL server but your table name may require quotation marks " " and they require escaping with \ so that they do not close the SQL statement. Try -sql "update \"table_name\" set …. " Simple test to verify if the problem is caused by the unquoted table name is to run o

Re: [gdal-dev] ogr2ogr project/transform CRS in the same database table

2020-12-02 Thread Hector muro
Hi again, I've given your idea a go: ogrinfo -dialect sqlite -sql "update set = ST_AsText(ST_Transform(geometry),4326)" --config MSSQLSPATIAL_USE_GEOMETRY_COLUMNS NO "$connect_string" This connects correctly, as I get this message: INFO: Open of `MSSQL:server=xxx;database=xxx;UID=xxx;PWD=xx;D

Re: [gdal-dev] gdal_create: input file option

2020-12-02 Thread Even Rouault
On mardi 1 décembre 2020 13:23:58 CET Rahkonen Jukka (MML) wrote: > Hi, > > Every now and then people would like to rasterize vectors into raster that > matches exactly with some existing raster. There are a few possible ways > for creating an empty copy from a raster with GDAL tools > https://gis