Wenbo,
The law of physics is in play here. I think your approach is
creative and valid. I wish Postgis offered grid-base spatial
index which grouped geometry BBOXs in grids with user defined
levels /sizes. A couple of other thoughts:
1. You may also look in to table partitioning to physically breakup the large table.
2. In addition, depend on how your data is used and whether or
not the data is static, vector-tiling/cacheing the geometry on
disk (out-side of database) may help.
Bo
_______________________________________________ postgis-users mailing list postgi...@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/postgis-users
GiST indexes work on bounding boxes only, so the portion of the row that
matters to the index is the same size per row. I would expect the two
factors that matter most for index size and generation speed to be
number of rows and number of pages. You've reduced the number of rows
and possibly the number of pages, so it's expected the index will be
smaller and faster to generate.
If you're loading up the data a method faster than CLUSTER is to create
a new table with CREATE TABLE foo AS SELECT * FROM foo_tmp ORDER BY
ST_GeoHash(ST_Transform(ST_Envelope(way),4326),10) COLLATE "C"
With CLUSTER you have to create a temporary index, rewrite the table,
and then recreate that temporary index, only to drop it again.
> On Jan 21, 2019, at 1:00 PM, Simon Greener <si...@spatialdbadvisor.com> wrote:
>
> When a geography is casted to geometry for use in the aggregate form of ST_Union (or other commands such as ST_Within) is the processing done assuming the data is projected even when geodetic?
All processing of geometry make cartesian assumptions. Processing of geography using geography native functions (no casting required) makes spherical assumptions. When you case from geography::geometry you are telling the database “please process this data using cartesian assumptions”. Do we support spherical processing for all (or even many) kinds of operations? No we do not. That’s hard. Could we in the future? Sure, it might happen.
ATB,
P
> On Jan 21, 2019, at 1:28 PM, Simon Greener <si...@spatialdbadvisor.com> wrote:
>
> I can't find a suitable gnomic srid for PostGIS.
>
You’re going to want one centred on Ireland, not the pole, and I think maybe it’s wanting a geodetic basis, try this:
+proj=gnom +lat_0=53.35 +lon_0=-6.26 +x_0=0 +y_0=0 +ellps=WGS84 +units=m +no_defs
However, I get the same number of distinct st_isvalidreason results.
Is there anything I can do with ogr2ogr when loading to help?
Simon
On Tue, 22 Jan 2019 08:34:02 +1100, Paul Ramsey <pra...@cleverelephant.ca> wrote:
> +proj=gnom +lat_0=53.35 +lon_0=-6.26 +x_0=0 +y_0=0 +ellps=WGS84 +units=m +no_defs
--
Regards
Simon
--------------------------------------------------------------------------------------------------------
Spatial Advice & Solutions Architecture
Database Spatial Stored Procedure Designer
Oracle Spatial, SQL Server, PostGIS, MySQL, ArcSDE FME
Awarded "2011 Oracle Spatial Excellence Award for Education and Research"
A: 39 Cliff View Drive, Allens Rivulet, 7150, Tas, Aust
W: www.spdba.com.au
E: si...@spdba.com.au
V: +61 362 396 397
M: +61 418 396 391
GITC Supplier: T1005
Skype: sggreener
Long: 147.20515 (147° 12' 18" E)
Lat: -43.01530 (43° 00' 55" S)
GeoHash: r22em9r98wg
NAC:W80CK 7SWP3
> On Jan 21, 2019, at 1:46 PM, Simon Greener <si...@spatialdbadvisor.com> wrote:
>
> Thanks Paul.
>
> However, I get the same number of distinct st_isvalidreason results.
Something is awry here, because I get only 'Valid Geometry’ as a validity check result… I loaded your shape file, I have 42 irish counties, I didn’t even try to use geography, just used geometry and they are all valid to start with.
I can even push them through a couple casts and they remain valid (as I would hope they would, since the coordinates shouldn’t change)
select distinct st_isvalidreason(geom::geography::geometry) from county;
P
_______________________________________________
On Jan 21, 2019, at 1:46 PM, Simon Greener <si...@spatialdbadvisor.com> wrote:
Thanks Paul.
However, I get the same number of distinct st_isvalidreason results.
Something is awry here, because I get only 'Valid Geometry’ as a validity check result… I loaded your shape file, I have 42 irish counties, I didn’t even try to use geography, just used geometry and they are all valid to start with.
I can even push them through a couple casts and they remain valid (as I would hope they would, since the coordinates shouldn’t change)
select distinct st_isvalidreason(geom::geography::geometry) from county;
P
Is there anything I can do with ogr2ogr when loading to help?
Simon
On Tue, 22 Jan 2019 08:34:02 +1100, Paul Ramsey <pra...@cleverelephant.ca> wrote:
+proj=gnom +lat_0=53.35 +lon_0=-6.26 +x_0=0 +y_0=0 +ellps=WGS84 +units=m +no_defs
--
Regards
Simon