[postgis-users] Handling N-d arrays in PostGIS
Paul Ramsey
pramsey at cleverelephant.ca
Mon Oct 30 05:25:48 PDT 2017
As others have noted, a POINTM or MULTIPOINTM will serve to store your data
just fine, but what you plan to *do* with that data after will determine
whether a relational database is really the correct tool for you.
ATB,
P
On Mon, Oct 30, 2017 at 4:56 AM, Antonio Rodriges <antonio.rrz at gmail.com>
wrote:
> I suppose it has a bit different purpose (like an efficient handling of
> sparsity which is not the case with dense climate data) and I hope there is
> an easier solution (I just have 3 dimensions...)
>
> Antonio
>
> 2017-10-30 14:52 GMT+03:00 Stephen V. Mather <svm at clevelandmetroparks.com>
> :
>
>> Ya, I’m not sure point clouds are at all the fix. They just address the
>> dimensionality question well, though not the gridded data requirement.
>>
>> Cheers,
>> Best,
>> Steve
>>
>>
>> [image: http://sig.cmparks.net/cmp-ms-90x122.png]*Stephen V. Mather*
>> GIS Manager
>> (216) 635-3243 (Work)
>> (216) 339-6347 (Cell)
>> --sent from phone--
>>
>>
>>
>> On Oct 30, 2017, at 07:49, Antonio Rodriges <antonio.rrz at gmail.com>
>> wrote:
>>
>> Thank you for pointing to this tool.
>>
>> However, I thought that since PostGIS uses GDAL it may be easier to
>> import such arrays, e.g. just split them onto individual 2-d grids (since
>> PostGIS mainly understands 2-d grids).
>>
>> 2017-10-30 14:34 GMT+03:00 Stephen V. Mather <svm at clevelandmetroparks.com
>> >:
>>
>>> I don’t know if it’s the ideal tool for the job, as it’s more flexible
>>> than you need, not being a regularized grid but a point cloud, but you
>>> might look to the pgPointCloud extension: https://github.com/
>>> pgpointcloud/pointcloud
>>>
>>> Cheers,
>>> Best,
>>> Steve
>>>
>>>
>>> [image: http://sig.cmparks.net/cmp-ms-90x122.png]*Stephen V. Mather*
>>> GIS Manager
>>> (216) 635-3243 (Work)
>>> (216) 339-6347 (Cell)
>>> --sent from phone--
>>>
>>>
>>>
>>> On Oct 30, 2017, at 07:09, Antonio Rodriges <antonio.rrz at gmail.com>
>>> wrote:
>>>
>>> Hello,
>>>
>>> Thank you for the reply, however my data is slightly different. Sorry
>>> that I did not make it clearer at the very beginning.
>>>
>>> Actually I would like to import a dense, 3-d array of wind speed (a
>>> time series of grids, each grid point contains the wind speed value)
>>>
>>> The array is stored as a NetCDF file
>>> FIles are here https://www.esrl.noaa.gov/psd/
>>> cgi-bin/db_search/DBListFiles.pl?did=61&tid=59909&vid=4298
>>>
>>> The size of the array and its dimensions are below
>>>
>>> dimensions:
>>> lat = 94 ;
>>> lon = 192 ;
>>> time = 1460;
>>>
>>> The array
>>>
>>> short uwnd(time,lat,lon) ;
>>> uwnd:long_name = "6-Hourly Forecast of U-wind at 10 m" ;
>>> uwnd:valid_range = -32765s, -8765s ;
>>> uwnd:unpacked_valid_range = -120.f, 120.f ;
>>> uwnd:actual_range = -38.2f, 38.07f ;
>>> uwnd:units = "m/s" ;
>>> uwnd:add_offset = 207.65f ;
>>> uwnd:scale_factor = 0.01f ;
>>> uwnd:missing_value = 32766s ;
>>> uwnd:_FillValue = -32767s ;
>>> uwnd:precision = 2s ;
>>> uwnd:least_significant_digit = 1s ;
>>> uwnd:GRIB_id = 33s ;
>>> uwnd:GRIB_name = "U GRD" ;
>>> uwnd:var_desc = "u-wind" ;
>>> uwnd:dataset = "NCEP/DOE AMIP-II Reanalysis (Reanalysis-2)" ;
>>> uwnd:level_desc = "10 m" ;
>>> uwnd:statistic = "Individual Obs" ;
>>> uwnd:parent_stat = "Other" ;
>>> uwnd:standard_name = "eastward_wind" ;
>>>
>>> 2017-10-30 11:04 GMT+03:00 Giuseppe Broccolo <g.broccolo.7 at gmail.com>:
>>>
>>> Hi Antonio,
>>>
>>>
>>> 2017-10-29 12:31 GMT+01:00 Antonio Rodriges <antonio.rrz at gmail.com>:
>>>
>>>
>>> Hello,
>>>
>>>
>>> Whether PostGIS allow importing 3-d, 4-d, etc. arrays or only 2-d arrays?
>>>
>>>
>>> Specifically, I have a 3-d array with axes (time, lat, lon).
>>>
>>> Does this mean that I need to split it onto 2-d bands (lat, lon) and
>>>
>>> import the number of bands that is equal to the number of time steps
>>>
>>> in the 3-d array?
>>>
>>>
>>>
>>> Which is the data source from which you import the data (e.g. textual,
>>>
>>> etc.)?
>>>
>>>
>>> If I've correctly understood, you have arrays where geospatial and
>>>
>>> non-geospatial information
>>>
>>> is present, each one providing a "dimension" of the array.
>>>
>>>
>>> Just FYI, in PostGIS is possible to define mixed, structured data with
>>>
>>> constructors like POINTM
>>>
>>> and POINT, that allow to add a further dimension to the 2D/3D
>>> (respectively)
>>>
>>> geospatial ones, that
>>>
>>> includes a scalar information.
>>>
>>>
>>> Hope this can help in your import, otherwise provide more information
>>> about
>>>
>>> source data and how
>>>
>>> you'd like to import.
>>>
>>>
>>> Giuseppe.
>>>
>>>
>>>
>>> _______________________________________________
>>>
>>> postgis-users mailing list
>>>
>>> postgis-users at lists.osgeo.org
>>>
>>> https://lists.osgeo.org/mailman/listinfo/postgis-users
>>>
>>> _______________________________________________
>>> postgis-users mailing list
>>> postgis-users at lists.osgeo.org
>>> https://lists.osgeo.org/mailman/listinfo/postgis-users
>>>
>>>
>>> _______________________________________________
>>> postgis-users mailing list
>>> postgis-users at lists.osgeo.org
>>> https://lists.osgeo.org/mailman/listinfo/postgis-users
>>>
>>
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users at lists.osgeo.org
>> https://lists.osgeo.org/mailman/listinfo/postgis-users
>>
>>
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users at lists.osgeo.org
>> https://lists.osgeo.org/mailman/listinfo/postgis-users
>>
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20171030/1ca6c5b2/attachment.html>
More information about the postgis-users
mailing list