[gdal-dev] New config option for date/time output

2016-03-15 Thread Ari Jolma

Folks,

The OGRFeature::GetFieldAsString returns date/time fields formatted in 
non-standard way. For example date is output as "year/month/day" as more 
usual "year-month-day". This causes problems in many programs.


I suggest adding a new config option OGR_DATE_FORMAT, which, if set, 
would make the method return date/time formatted according to it. I 
suggest that we use the strftime and its format argument as the target 
for the new option.


The implementation is complicated a bit when milliseconds and timezones 
are involved since they are not included in the struct tm used by 
strftime. I suggest that we assume seconds are formatted as :\d\d in the 
format and simply add milliseconds (as .\d\d\d) and timezone (as 
[+-]\d\d(:\d\d)), if they exists, after the second.


Do you think this needs a RFC?

I'm willing to implement the changes.

Ari

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

Re: [gdal-dev] New config option for date/time output

2016-03-15 Thread Ari Jolma



15.03.2016, 11:15, Ari Jolma kirjoitti:

Folks,

The OGRFeature::GetFieldAsString returns date/time fields formatted in 
non-standard way. For example date is output as "year/month/day" as 
more usual "year-month-day". This causes problems in many programs.


I suggest adding a new config option OGR_DATE_FORMAT, which, if set, 
would make the method return date/time formatted according to it. I 
suggest that we use the strftime and its format argument as the target 
for the new option.


The implementation is complicated a bit when milliseconds and 
timezones are involved since they are not included in the struct tm 
used by strftime. I suggest that we assume seconds are formatted as 
:\d\d in the format and simply add milliseconds (as .\d\d\d) and 
timezone (as [+-]\d\d(:\d\d)), if they exists, after the second.


It seems that the standard way of formatting time offset is +hhmm or 
-hhmm (without ':' between hours and minutes) (ISO 8601:2000).




Do you think this needs a RFC?

I'm willing to implement the changes.

Ari



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

Re: [gdal-dev] New config option for date/time output

2016-03-15 Thread Joaquim Luis

GMT uses "yyy-mm-ddT[hh:mm:ss] (Gregorian) or -Www-ddT[hh:mm:ss] (ISO)"

http://gmt.soest.hawaii.edu/doc/latest/gmt.conf.html#calendar-time-parameters

It would be nice to use the same.

Joaquim


Folks,

The OGRFeature::GetFieldAsString returns date/time fields formatted in  
non-standard way. For example date is output as "year/month/day" as more  
usual "year-month-day". This causes problems in many programs.


I suggest adding a new config option OGR_DATE_FORMAT, which, if set,  
would make the method return date/time formatted according to it. I  
suggest that we use the strftime and its format argument as the target  
for the new option.


The implementation is complicated a bit when milliseconds and timezones  
are involved since they are not included in the struct tm used by  
strftime. I suggest that we assume seconds are formatted as :\d\d in the  
format and simply add milliseconds (as .\d\d\d) and timezone (as  
[+-]\d\d(:\d\d)), if they exists, after the second.


Do you think this needs a RFC?

I'm willing to implement the changes.

Ari

___
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] New config option for date/time output

2016-03-15 Thread Ari Jolma

15.03.2016, 14:08, Joaquim Luis kirjoitti:
GMT uses "yyy-mm-ddT[hh:mm:ss] (Gregorian) or -Www-ddT[hh:mm:ss] 
(ISO)"


http://gmt.soest.hawaii.edu/doc/latest/gmt.conf.html#calendar-time-parameters 



It would be nice to use the same.


I'm not sure I understand you correctly but strftime can do this:

OGR_DATETIME_FORMAT = "%Y-%m-%dT%H:%M:%S"

gives for example 2016-01-10T08:25:12 and

OGR_DATETIME_FORMAT = "%Y-%W-%dT%H:%M:%S"

gives 2016-01-10T08:25:12 for the same time - 10.1.2016 is on week two 
(strftime: %W = Week number with the first Monday as the first day of 
week one (00-53))


I think that there needs to be separate options for date and datetime, 
i.e., OGR_DATE_FORMAT and OGR_DATETIME_FORMAT.


Ari



Joaquim


Folks,

The OGRFeature::GetFieldAsString returns date/time fields formatted 
in non-standard way. For example date is output as "year/month/day" 
as more usual "year-month-day". This causes problems in many programs.


I suggest adding a new config option OGR_DATE_FORMAT, which, if set, 
would make the method return date/time formatted according to it. I 
suggest that we use the strftime and its format argument as the 
target for the new option.


The implementation is complicated a bit when milliseconds and 
timezones are involved since they are not included in the struct tm 
used by strftime. I suggest that we assume seconds are formatted as 
:\d\d in the format and simply add milliseconds (as .\d\d\d) and 
timezone (as [+-]\d\d(:\d\d)), if they exists, after the second.


Do you think this needs a RFC?

I'm willing to implement the changes.

Ari

___
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 mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] New config option for date/time output

2016-03-15 Thread Joaquim Luis

On Tue, 15 Mar 2016 13:01:29 -, Ari Jolma  wrote:


15.03.2016, 14:08, Joaquim Luis kirjoitti:
GMT uses "yyy-mm-ddT[hh:mm:ss] (Gregorian) or -Www-ddT[hh:mm:ss]  
(ISO)"


http://gmt.soest.hawaii.edu/doc/latest/gmt.conf.html#calendar-time-parameters  
It would be nice to use the same.


I'm not sure I understand you correctly but strftime can do this:

OGR_DATETIME_FORMAT = "%Y-%m-%dT%H:%M:%S"

gives for example 2016-01-10T08:25:12 and

OGR_DATETIME_FORMAT = "%Y-%W-%dT%H:%M:%S"

gives 2016-01-10T08:25:12 for the same time - 10.1.2016 is on week two  
(strftime: %W = Week number with the first Monday as the first day of  
week one (00-53))


Sorry, it was me who misunderstood your question/suggestion. I thought  
that printing with the above format was not possible yet and that's why I  
pointed to what GMT does. But if GDAL can do it already, than sorry for  
the noise.


Joaquim

I think that there needs to be separate options for date and datetime,  
i.e., OGR_DATE_FORMAT and OGR_DATETIME_FORMAT.


Ari



Joaquim


Folks,

The OGRFeature::GetFieldAsString returns date/time fields formatted in  
non-standard way. For example date is output as "year/month/day" as  
more usual "year-month-day". This causes problems in many programs.


I suggest adding a new config option OGR_DATE_FORMAT, which, if set,  
would make the method return date/time formatted according to it. I  
suggest that we use the strftime and its format argument as the target  
for the new option.


The implementation is complicated a bit when milliseconds and  
timezones are involved since they are not included in the struct tm  
used by strftime. I suggest that we assume seconds are formatted as  
:\d\d in the format and simply add milliseconds (as .\d\d\d) and  
timezone (as [+-]\d\d(:\d\d)), if they exists, after the second.


Do you think this needs a RFC?

I'm willing to implement the changes.

Ari

___
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 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] New config option for date/time output

2016-03-15 Thread Ari Jolma

15.03.2016, 15:59, Joaquim Luis kirjoitti:
On Tue, 15 Mar 2016 13:01:29 -, Ari Jolma  
wrote:



15.03.2016, 14:08, Joaquim Luis kirjoitti:
GMT uses "yyy-mm-ddT[hh:mm:ss] (Gregorian) or -Www-ddT[hh:mm:ss] 
(ISO)"


http://gmt.soest.hawaii.edu/doc/latest/gmt.conf.html#calendar-time-parameters 
It would be nice to use the same.


I'm not sure I understand you correctly but strftime can do this:

OGR_DATETIME_FORMAT = "%Y-%m-%dT%H:%M:%S"

gives for example 2016-01-10T08:25:12 and

OGR_DATETIME_FORMAT = "%Y-%W-%dT%H:%M:%S"

gives 2016-01-10T08:25:12 for the same time - 10.1.2016 is on week 
two (strftime: %W = Week number with the first Monday as the first 
day of week one (00-53))


Sorry, it was me who misunderstood your question/suggestion. I thought 
that printing with the above format was not possible yet and that's 
why I pointed to what GMT does. But if GDAL can do it already, than 
sorry for the noise.



It can't. That's why I'm suggesting this. The core of my suggestion is 
to start using the strftime function and the config options.


I've actually implemented it already for testing, that's why I may sound 
like that GDAL can do it already.


Cheers,

Ari




Joaquim

I think that there needs to be separate options for date and 
datetime, i.e., OGR_DATE_FORMAT and OGR_DATETIME_FORMAT.


Ari



Joaquim


Folks,

The OGRFeature::GetFieldAsString returns date/time fields formatted 
in non-standard way. For example date is output as "year/month/day" 
as more usual "year-month-day". This causes problems in many programs.


I suggest adding a new config option OGR_DATE_FORMAT, which, if 
set, would make the method return date/time formatted according to 
it. I suggest that we use the strftime and its format argument as 
the target for the new option.


The implementation is complicated a bit when milliseconds and 
timezones are involved since they are not included in the struct tm 
used by strftime. I suggest that we assume seconds are formatted as 
:\d\d in the format and simply add milliseconds (as .\d\d\d) and 
timezone (as [+-]\d\d(:\d\d)), if they exists, after the second.


Do you think this needs a RFC?

I'm willing to implement the changes.

Ari

___
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 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] [Windows/ C#] Gdal dll conflicts

2016-03-15 Thread Jerome Siot
Hello,
I'm currently deploying a Gdal-based application on various Windows-PCs.

For some of them, there are integration problems, due to dll conflicts. As an 
example:


1)  Here is my app directory structure :

MyApp
  |
  |-- gdal
  ||
  ||- gdal201.dll
  ||- libeay32.dll
  ||- ssleay32.dll
  ||- ...
  |
  |-- myApp.exe
  |-- othersDll.dll


2)  On some of the PCs I use, libeay32.dll and ssleay32.dll are also 
present on C:\Windows\SysWOW64 folder, in versions different from mines.

3)  When the app loads gdal201.dll, dependencies are loaded first in 
C:\Windows\SysWOW64 folder ==> C:\Windows\SysWOW64 \libeay32.dll and 
ssleay32.dll are loaded, that causes a crash.

I checked that :

-  In GdalConfiguration.cs, GdalConfiguration(), my PATH env var is 
correctly overriden
var gdalPath = Path.Combine(executingDirectory, "gdal-2.0.1");
var nativePath = Path.Combine(gdalPath, GetPlatform());

// Prepend native path to environment path, to ensure the
// right libs are being used.
var path = Environment.GetEnvironmentVariable("PATH");
path = nativePath + ";" + Path.Combine(nativePath, "plugins") + ";" + path;
Environment.SetEnvironmentVariable("PATH", path);


-  Using a file access monitoring tool (ProcessMonitor, from 
Microsoft), I observe that dll search order is :

o   myApp.exe directory

o   C:\windows\ SysWOW64

o   C:\windows\System32

o   C:\...\MyApp\gdal-2.0.1

ð  This is not compliant with PATH overriding

After browsing internet (including the mailing-list :)), I don't want to :

-  Compile gdal statically,

-  Copy gdal dependencies in myApp.exe root directory,

-  Comment some lines of my makefile in order to avoid dependencies 
such as libeay32.dll or ssleay32.dll.


Have you got ideas about this problem ?

--
Thank you, Jérome Siot

(Excuse me for my awful English, I'm French !)











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

Re: [gdal-dev] GSOC 2016

2016-03-15 Thread Dmitry Baryshnikov

Hi Sarthak,

The first version is not working (do you test it?): 
https://github.com/sarthak-0415/gdal/commit/36344cc26f23202cb289390322c1d295697136bd#diff-31df0e62d00ca09f9f11ad2f29e94b54R2541
Here you try to get array value with index -1. You need to set 
ppszDbname = NULL no DB name present in input parameters.


The second variant is not working too:
>>> ds = gdal.Open('PG:')
terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string::_M_construct null not valid

In both cases there is a problem here: 
https://github.com/sarthak-0415/gdal/blob/6264d3fc52242fdce858547cc3a0312b04fd638b/gdal/frmts/postgisraster/postgisrasterdataset.cpp#L2743


Also look there ppszDbname is using, as before modifications the code 
expect that ppszDbname cannot be NULL.


Best regards,
Dmitry

15.03.2016 13:13, sarthak agarwal пишет:


Hey Dmitry ,
As discussed on the IRC yesterday,
I made the changes in the code.

I build two versions of the code

1.

The changes suggested by you (to use the old trunk code and remove
the additional checks) link


travis  .
a. in this version the Dbname is left empty if not provided by the
user.

2.

The version in which we
a. if the Dbname is provided by the user then ppzDbname=Dbname.
b. else use the psql env var PGDATABASE
c. else use the Username as the database name.
d. if nothing is available then pass empty string.
e link


travis 

I think both version should work

Regards,
Sarthak

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