Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] Re: Can uDig plot PostGIS data from an SQL view?

Gary Lucas wrote:

I hadn't thought of this before my last email, but later it
occured to me to insert an entry into the geometry_columns table
so that it matched the record from the original table on which the
view is based (with the name of the view appearing in
the "f_table_name" column).  Still nothing
plotted. It did make a difference in that when I ran uDig and brought up the "Resource Summary" it now shows the correct value for the Coordinate Reference System (CRS) which, in this case, is just EPSG:WGS84 (SRID=4326). On the other hand, the values in the Bounds entry are rather suspicious being
(-494.9, -79.3), (483.1,144.3)    They seem to change everytime
I run the program.
I suspect that the GeoTools PostGIS implementation currently does not know to treat views differently from tables. The estimate_extents function likely fails on the view, and an approximation is made based on a handful of features (if it fails it should check if it is a view and ask the table -- if available -- what its bounds are). We should investigate further to ensure that indexes are properly exploited.

Your view is the only layer in your map? Also, you may need to remove your PostGIS database from the uDig catalog and re-import it, as the bounds and state will be cached.

Could there be another table beside geometry_columns that
needs an additional entry?

Also, I didn't name my geometry column "the_geom" which seems
to be a prefered default in some of the GeoTools code.
The entry in the geometry_columns table for your view should be identical to the one for the original table except for the table name.

If you don't have any luck, could you send me your table schema and geometry columns entries so I might see if there is a case we aren't handling correctly?

Thanks,
Cory.


Back to the top