[GRASS-dev] [GRASS GIS] #2499: v.in.ogr in does not handle "nan" in attribute tables properly
GRASS GIS
trac at osgeo.org
Wed Jan 8 13:56:04 PST 2020
#2499: v.in.ogr in does not handle "nan" in attribute tables properly
--------------------------+-----------------------------------------
Reporter: sbl | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 7.8.3
Component: Vector | Version: unspecified
Resolution: | Keywords: v.in.ogr, DBMI, SQLite, nan
CPU: Unspecified | Platform: Unspecified
--------------------------+-----------------------------------------
Comment (by mmetz):
Replying to [comment:13 sbl]:
> In addition, the different DMBS behave differently with regards to
nan/inf...
>
> This is how PostgreSQL handles NaN / Inf in double columns:
[...]
>
> {{{
> SELECT * FROM test_insert_nan WHERE double_column > 0;
> }}}
>
> {{{
> double_column
> double precision
> "NaN"
> "NaN"
> "Infinity"
> }}}
this is wrong because nan is not > 0. nan is also not < 0 and not equal 0.
nan is also not equal nan. Apparently a bug in how PostgreSQL handles NaN.
Regarding v.in.ogr, I guess that setting nan/inf to NULL is the safest
option.
GRASS modules that create attribute tables should not insert nan/inf if
these values should not occur according to the logic of the module, as
e.g. v.net.centrality. If nan/inf does occur, the respective module needs
to be fixed.
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2499#comment:14>
GRASS GIS <https://grass.osgeo.org>
More information about the grass-dev
mailing list