[gdal-dev] UTF-8 problem with MSSQLSpatial and ogr2ogr

2012-03-29 Thread philippe.suray
Hello,

I am trying to load a shape file encoded in UTF-8 in SQLServer2008.
I use this command from ogr2ogr to load the data's:

ogr2ogr --debug on -f MSSQLSpatial
"MSSQL:server=localhost;database=ogr2ogrTest;Trusted_Connection=True;"
"myShapeFile.shp" -t_srs EPSG:4326 -dsco ENCODING=UTF-8 -lco ENCODING=UTF-8
-overwrite -progress

When I check the records in the DB, some fields are not correctly encoded.

According to SQLServer documentation and to my understanding: in order to
store unicode, the fields must be declared as NCHAR or NVARCHAR and the
insert or update statements must append 'N' before the value (INSERT INTO
tForeignLanguage ([Name]) VALUES (N'Араб'))

I also search about unicode in this list and found:
- http://osgeo-org.1560.n6.nabble.com/RFC-23-OGR-Unicode-td3759338.html
- http://trac.osgeo.org/gdal/wiki/rfc23_ogr_unicode

I downloaded the latest source code from http://www.gdal.org/daily/ and
check into mssqlspatial component and found that the driver does not respect
these assumptions:
- fields are created as VARCHAR,
- statements does not append 'N'

I really need this unicode support but I am not very familiar with C++,
could you help me to implement a patch to test the loading of a shapefile
into SQLServer2008.
What classes should I change and how?

Thank you for your help.

Best regards.

Philippe 

--
View this message in context: 
http://osgeo-org.1560.n6.nabble.com/UTF-8-problem-with-MSSQLSpatial-and-ogr2ogr-tp4670214p4670214.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] Ogr2OGR for GeoJSON fails on windows 7

2012-03-29 Thread Chaitanya kumar CH
Vivek,

Check if you have write permission to the directory.

On Fri, Mar 30, 2012 at 5:53 AM, Vivek Dey  wrote:

> Hi Eli
> My bad , i did typo in writing here. I have written correctly as GeoJSON
> for conversion.
> Thnks
> Vivek
> On 2012-03-29 4:23 PM, "Eli Adam"  wrote:
>
>> Vivek,
>>
>>I think you might have some minor typos:
>>
>> > ogr2ogr -f "geoJSAON CENO.json CENOVUS.shp
>>
>> "GeoJSON" not
>> "geoJSAon [no ending double quote either]
>>
>> HTH, Eli
>>
>
> ___
> gdal-dev mailing list
> gdal-dev@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>



-- 
Best regards,
Chaitanya kumar CH.

+91-9494447584
17.2416N 80.1426E
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] Ogr2OGR for GeoJSON fails on windows 7

2012-03-29 Thread Eli Adam
Vivek,

> My bad , i did typo in writing here. I have written correctly as GeoJSON for
> conversion.

Are you saying that you typed it correctly on the command line and it
still doesn't work?  If so, can you copy your command and error from
the command line to the email?

Eli
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] Ogr2OGR for GeoJSON fails on windows 7

2012-03-29 Thread Vivek Dey
Hi Eli
My bad , i did typo in writing here. I have written correctly as GeoJSON
for conversion.
Thnks
Vivek
On 2012-03-29 4:23 PM, "Eli Adam"  wrote:

> Vivek,
>
>I think you might have some minor typos:
>
> > ogr2ogr -f "geoJSAON CENO.json CENOVUS.shp
>
> "GeoJSON" not
> "geoJSAon [no ending double quote either]
>
> HTH, Eli
>
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] Ogr2OGR for GeoJSON fails on windows 7

2012-03-29 Thread Eli Adam
Vivek,

I think you might have some minor typos:

> ogr2ogr -f "geoJSAON CENO.json CENOVUS.shp

"GeoJSON" not
"geoJSAon [no ending double quote either]

HTH, Eli
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


[gdal-dev] Ogr2OGR for GeoJSON fails on windows 7

2012-03-29 Thread Vivek Dey
Hi All

I am a newbie of GDAL.

I want to convert a shape file to GeoJSON file.

I have downloaded GDAL 19 (MSVC 2010 win64) binaries.

However, when I try to convert to GeoJSON.

It says "Failed to create geoJSON datasource"

I am using the following code

ogr2ogr -f "geoJSAON CENO.json CENOVUS.shp

Please tell me where I am wrong.

Thanks

Vivek
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] Re: Error in creating gml file

2012-03-29 Thread Salvatore Larosa
Il giorno gio, 29/03/2012 alle 14.47 -0700, proto83 ha scritto:
> ok i did it and i the output was this.
> INFO:Open of 'c:\shapefiles\oikismoi_irakliou.shp'
> using driver 'ESRI Shapefile' successful
> 1:oikismoi_irakliou 

Can you try ogr2ogr command in a different folder?

For example in the Desktop folder.




___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


[gdal-dev] Re: Error in creating gml file

2012-03-29 Thread proto83
ok i did it and i the output was this.
INFO:Open of 'c:\shapefiles\oikismoi_irakliou.shp'
using driver 'ESRI Shapefile' successful
1:oikismoi_irakliou 


--
View this message in context: 
http://osgeo-org.1560.n6.nabble.com/Error-in-creating-gml-file-tp4669016p4669302.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] Re: Error in creating gml file

2012-03-29 Thread Salvatore Larosa
Il giorno gio, 29/03/2012 alle 14.00 -0700, proto83 ha scritto:
> no i am in windows.but i still cannot understand what i must do to fix the
> problem.
> 
> --

well, will be hard reach a solution! ;-)

try ogrinfo command:

ogrinfo oikismoi_irakliou.shp



___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


[gdal-dev] Re: Error in creating gml file

2012-03-29 Thread proto83
no i am in windows.but i still cannot understand what i must do to fix the
problem.

--
View this message in context: 
http://osgeo-org.1560.n6.nabble.com/Error-in-creating-gml-file-tp4669016p4669179.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] Re: Error in creating gml file

2012-03-29 Thread Salvatore Larosa
Il giorno gio, 29/03/2012 alle 13.31 -0700, proto83 ha scritto:
> can you explain me more if it's not problem for you? :)


I assume you are on Linux!

What returns this command: 

$ ls -l | grep yourFolder  

?

"youFolder" is the folder where you save your files!




___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


[gdal-dev] Re: Error in creating gml file

2012-03-29 Thread proto83
can you explain me more if it's not problem for you? :)

--
View this message in context: 
http://osgeo-org.1560.n6.nabble.com/Error-in-creating-gml-file-tp4669016p4669107.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] Error in creating gml file

2012-03-29 Thread Even Rouault
Le jeudi 29 mars 2012 22:03:06, proto83 a écrit :
> ogr2ogr -f "GML" oikismoi_irakliou_gml.gml oikismoi_irakliou.shp
> 
> i write this in the command line and i receive the following message.
> 
> ERROR4:Failed to create GML file oikismoi_irakliou_gml.gml
> GML driver failed to create oikismoi_irakliou_gml.gml
> 
> Does anyone knows what is the problem?

Looking at the code, this error messages really comes from we cannot open a 
file in read/write mode on the filesystem. You should check the filesystem 
permissions on that directory/file

> 
> Regards,
> Spiros.
> 
> --
> View this message in context:
> http://osgeo-org.1560.n6.nabble.com/Error-in-creating-gml-file-tp4669016p4
> 669016.html Sent from the GDAL - Dev mailing list archive at Nabble.com.
> ___
> gdal-dev mailing list
> gdal-dev@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


[gdal-dev] Error in creating gml file

2012-03-29 Thread proto83
ogr2ogr -f "GML" oikismoi_irakliou_gml.gml oikismoi_irakliou.shp

i write this in the command line and i receive the following message.

ERROR4:Failed to create GML file oikismoi_irakliou_gml.gml
GML driver failed to create oikismoi_irakliou_gml.gml

Does anyone knows what is the problem?

Regards,
Spiros.

--
View this message in context: 
http://osgeo-org.1560.n6.nabble.com/Error-in-creating-gml-file-tp4669016p4669016.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


RE: [gdal-dev] Interpretation of DTED elevation data

2012-03-29 Thread Alex Barféty
I've used the ReadRaster method with a short array and it working perfectly
fine, the elevation data recovered are correct.

Thanks for your advice :)

Alex Barféty


-Message d'origine-
De : Even Rouault [mailto:even.roua...@mines-paris.org] 
Envoyé : mercredi 28 mars 2012 10:23
À : AlexRNL
Cc : gdal-dev@lists.osgeo.org
Objet : Re: [gdal-dev] Interpretation of DTED elevation data

Selon AlexRNL :

> Hi everyone!
>
>
> I have been trying to extract elevation data from a DTED file using 
> GDAL (in Java). The file being loaded is of level 0 precision and 
> seems to be correct as an import into Global Mapper is rendering the
expected result.
>
>
> I managed to retrieve the image data but I don't know to transform 
> those values into a altitude in meters.
>
>
> According to the DTED format specification, the elevation values are 
> supposed to be two-bytes integer in meters. But, when using the 
> http://www.gdal.org/java/org/gdal/gdal/Band.html#ReadRaster_Direct(int
> , int, int, int, int, int, int, java.nio.ByteBuffer) ReadRaster_Direct 
> method, the buffer retrieved is supposed to be composed of Int16 
> number but when i'm converting the raw data (bytes) into a short array 
> i'm getting all sorts of value which doesn't make a lot of sense. The 
> range of the elevation is spanning from 1 to 65286!
>
>
> Is there a conversion that i'm missing? How do I get the meter value 
> from the raster returned by GDAL?

You should make sure to request with buf_type = gdalconst.GDT_Int16. Then
iterating the buffer with getShort() should deliver the expected values.

Otherwise use the version of ReadRaster() that accepts a short[]. That will
be simpler to use.

The benefit of using ByteBuffer instead standard Java arrays only appears
with
*huge* arrays

>
>
> I've been searching for a while but it doesn't seem like anyone has 
> that kind of problem...
>
>
> Thanks in advance for any information that may help me :)
>
> Alex.
>
> --
> View this message in context:
>
http://osgeo-org.1560.n6.nabble.com/gdal-dev-Interpretation-of-DTED-elevatio
n-data-tp4663511p4663511.html
> Sent from the GDAL - Dev mailing list archive at Nabble.com.




___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] fail to build gdal 1.9 with minGW

2012-03-29 Thread chenliang wang
I think I get it more clearly. It 's a linking problem now. When I 
compiled GDAL 1.9 linked statically with proj. I got the error 
'undefined reference to 'pj_init' '. The libray 'libproj.a' must be set 
in my project. But I use same configure script to test my GDAL 1.6. It 
turns out that I just need to set ' libgdal.a' without ' libproj.a' .

How can I make the linking way of GDAL 1.9 just like 1.6 ?

于 2012-3-29 16:23, Even Rouault 写道:

Selon chenliang wang:


Thanks for your reply. I have tried 'make clean' and then rebuild GDAL.
And I have also modified GNUmakefile ,replaed '${GDAL_ROOTs}' for '.'
and then 'make clean' and rebuild it again. Unfortunately, I failed
again. I use command ' ./configure --prefix=. ' Should I need to add
option '--host=mingw32' or '--without-libtool'?

I have not a mingw environment to test. Is it a compilation problem or a linking
problem ?


于 2012-3-29 15:52, Even Rouault 写道:

Selon chenliang wang:


hi:
I failed to build gdal 1.9 with minGW. I modified 'cpl_multiproc.h' with
the patch.But there are still errors with build:cpl_multiproc.cpp:73:
undefined reference to `CPLCreateOrAcquireMutex' .Pls help me out.Thanks!


---

#if defined(WIN32)&&   !defined(CPL_MULTIPROC_STUB)
# define CPL_MULTIPROC_WIN32
/* MinGW can have pthread support, so disable it to avoid issues */
/* in cpl_multiproc.cpp */
# undef CPL_MULTIPROC_PTHREAD
#endif




Did you 'make clean' after applying the patch and before rebuilding GDAL ?

The

reporter of https://trac.osgeo.org/gdal/ticket/4430 confirmed that the

above

patch fixed building for him.


Chen-liang Wang
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev









___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] fail to build gdal 1.9 with minGW

2012-03-29 Thread Even Rouault
Selon chenliang wang :

> Thanks for your reply. I have tried 'make clean' and then rebuild GDAL.
> And I have also modified GNUmakefile ,replaed '${GDAL_ROOTs}' for '.'
> and then 'make clean' and rebuild it again. Unfortunately, I failed
> again. I use command ' ./configure --prefix=. ' Should I need to add
> option '--host=mingw32' or '--without-libtool'?

I have not a mingw environment to test. Is it a compilation problem or a linking
problem ?

>
> 于 2012-3-29 15:52, Even Rouault 写道:
> > Selon chenliang wang:
> >
> >> hi:
> >> I failed to build gdal 1.9 with minGW. I modified 'cpl_multiproc.h' with
> >> the patch.But there are still errors with build:cpl_multiproc.cpp:73:
> >> undefined reference to `CPLCreateOrAcquireMutex' .Pls help me out.Thanks!
> >>
> >
>
---
> >> #if defined(WIN32)&&  !defined(CPL_MULTIPROC_STUB)
> >> # define CPL_MULTIPROC_WIN32
> >> /* MinGW can have pthread support, so disable it to avoid issues */
> >> /* in cpl_multiproc.cpp */
> >> # undef CPL_MULTIPROC_PTHREAD
> >> #endif
> >>
> >
>

> >
> > Did you 'make clean' after applying the patch and before rebuilding GDAL ?
> The
> > reporter of https://trac.osgeo.org/gdal/ticket/4430 confirmed that the
> above
> > patch fixed building for him.
> >
> >>
> >> Chen-liang Wang
> >> ___
> >> gdal-dev mailing list
> >> gdal-dev@lists.osgeo.org
> >> http://lists.osgeo.org/mailman/listinfo/gdal-dev
> >>
> >
> >
> >
>


___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] fail to build gdal 1.9 with minGW

2012-03-29 Thread chenliang wang
Thanks for your reply. I have tried 'make clean' and then rebuild GDAL. 
And I have also modified GNUmakefile ,replaed '${GDAL_ROOTs}' for '.' 
and then 'make clean' and rebuild it again. Unfortunately, I failed 
again. I use command ' ./configure --prefix=. ' Should I need to add 
option '--host=mingw32' or '--without-libtool'?


于 2012-3-29 15:52, Even Rouault 写道:

Selon chenliang wang:


hi:
I failed to build gdal 1.9 with minGW. I modified 'cpl_multiproc.h' with
the patch.But there are still errors with build:cpl_multiproc.cpp:73:
undefined reference to `CPLCreateOrAcquireMutex' .Pls help me out.Thanks!


---

#if defined(WIN32)&&  !defined(CPL_MULTIPROC_STUB)
# define CPL_MULTIPROC_WIN32
/* MinGW can have pthread support, so disable it to avoid issues */
/* in cpl_multiproc.cpp */
# undef CPL_MULTIPROC_PTHREAD
#endif




Did you 'make clean' after applying the patch and before rebuilding GDAL ? The
reporter of https://trac.osgeo.org/gdal/ticket/4430 confirmed that the above
patch fixed building for him.



Chen-liang Wang
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev






___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] GDAL Tiling

2012-03-29 Thread Even Rouault
Selon akshay gupta :

> I am presently using -srcwin for copying AOI to a different file. does
> -projwin have any advantage over -srcwin?

No, the underlying processing is the same. You just use what option is the more
convenient for you. In fact, when -projwin is used, the projected/geographic
coordinates are transformed into pixel coordinates.

>
> Akhy
>
> On Wed, Mar 28, 2012 at 5:29 PM, Jay L.  wrote:
>
> > Akshay,
> >
> > 1) An AOI can be created using the -projwin option in gdal_translate.  You
> > can use that option when creating a new raster with a new tiles size.
> >
> > 2) Using the Python bindings it is possible to read a segment of a raster
> > into memory without allocating memory.  I am unsure using another other
> > language.
> >
> > Jay
> >
> >
> > On Wed, Mar 28, 2012 at 5:16 AM, Mateusz Loskot wrote:
> >
> >> On 28 March 2012 07:45, akshay gupta  wrote:
> >> > 2) When I read an image through ReadBlock() i had to allocate some
> >> memory
> >> > and pass it in the function. Is there some way that i get the image data
> >> > stored in GDALRasterBlock directly without passing my own allocated
> >> memory.
> >>
> >> http://www.gdal.org/classGDALRasterBlock.html#_details
> >>
> >> "In normal situations applications do not interact directly
> >> with the GDALRasterBlock - instead it it utilized
> >> by the RasterIO() interfaces to implement caching"
> >>
> >> Best regards,
> >> --
> >> Mateusz Loskot, http://mateusz.loskot.net
> >>
> >
> >
>


___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] fail to build gdal 1.9 with minGW

2012-03-29 Thread Even Rouault
Selon chenliang wang :

> hi:
> I failed to build gdal 1.9 with minGW. I modified 'cpl_multiproc.h' with
> the patch.But there are still errors with build:cpl_multiproc.cpp:73:
> undefined reference to `CPLCreateOrAcquireMutex' .Pls help me out.Thanks!
>
---
> #if defined(WIN32) && !defined(CPL_MULTIPROC_STUB)
> # define CPL_MULTIPROC_WIN32
> /* MinGW can have pthread support, so disable it to avoid issues */
> /* in cpl_multiproc.cpp */
> # undef CPL_MULTIPROC_PTHREAD
> #endif
>


Did you 'make clean' after applying the patch and before rebuilding GDAL ? The
reporter of https://trac.osgeo.org/gdal/ticket/4430 confirmed that the above
patch fixed building for him.

>
>
> Chen-liang Wang
> ___
> gdal-dev mailing list
> gdal-dev@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>


___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] GDAL Tiling

2012-03-29 Thread akshay gupta
I am presently using -srcwin for copying AOI to a different file. does
-projwin have any advantage over -srcwin?

Akhy

On Wed, Mar 28, 2012 at 5:29 PM, Jay L.  wrote:

> Akshay,
>
> 1) An AOI can be created using the -projwin option in gdal_translate.  You
> can use that option when creating a new raster with a new tiles size.
>
> 2) Using the Python bindings it is possible to read a segment of a raster
> into memory without allocating memory.  I am unsure using another other
> language.
>
> Jay
>
>
> On Wed, Mar 28, 2012 at 5:16 AM, Mateusz Loskot wrote:
>
>> On 28 March 2012 07:45, akshay gupta  wrote:
>> > 2) When I read an image through ReadBlock() i had to allocate some
>> memory
>> > and pass it in the function. Is there some way that i get the image data
>> > stored in GDALRasterBlock directly without passing my own allocated
>> memory.
>>
>> http://www.gdal.org/classGDALRasterBlock.html#_details
>>
>> "In normal situations applications do not interact directly
>> with the GDALRasterBlock - instead it it utilized
>> by the RasterIO() interfaces to implement caching"
>>
>> Best regards,
>> --
>> Mateusz Loskot, http://mateusz.loskot.net
>>
>
>
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

[gdal-dev] fail to build gdal 1.9 with minGW

2012-03-29 Thread chenliang wang
hi:
I failed to build gdal 1.9 with minGW. I modified 'cpl_multiproc.h' with
the patch.But there are still errors with build:cpl_multiproc.cpp:73:
undefined reference to `CPLCreateOrAcquireMutex' .Pls help me out.Thanks!
---
#if defined(WIN32) && !defined(CPL_MULTIPROC_STUB)
# define CPL_MULTIPROC_WIN32
/* MinGW can have pthread support, so disable it to avoid issues */
/* in cpl_multiproc.cpp */
# undef CPL_MULTIPROC_PTHREAD
#endif



Chen-liang Wang
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev