Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-users] Odd behavior displaying PostGIS layers from Census Shapefiles

Afternoon:

Comments inline ...

On 29/06/2010, at 2:22 AM, David Epstein wrote:

> Hi folks,
> 
> 
> I am relatively new to Udig & PostGIS. I am using Ubuntu 9.04 and Udig
> 1.2-RC3.
> 
> I am having trouble displaying PostGIS layers generated from US Census
> shapefiles available at:
> 
> http://www2.census.gov/cgi-bin/shapefiles2009/national-files
> 
> I load the shapefiles into PostGIS using this statement on the
> commandline:
> 
> shp2pgsql -W IBM850 -s 4269 -c County99_d00 county99_pg US_National |
> psql -d US_National
> 
> I believe that the text encoding and SRID are correct. The loading
> appears to proceed without a problem.

So the SRID is 4269 - that shows up as:

GEOGCS["NAD83", 
  DATUM["North American Datum 1983", 
    SPHEROID["GRS 1980", 6378137.0, 298.257222101, AUTHORITY["EPSG","7019"]], 
    TOWGS84[1.0, 1.0, -1.0, 0.0, 0.0, 0.0, 0.0], 
    AUTHORITY["EPSG","6269"]], 
  PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], 
  UNIT["degree", 0.017453292519943295], 
  AXIS["Geodetic longitude", EAST], 
  AXIS["Geodetic latitude", NORTH], 
  AUTHORITY["EPSG","4269"]]

So we are looking at lon / lat data

> After adding the layers using Layer-->Add, the layers are displayed in
> the lefthand layer window with small X's signifying something is wrong.

When you select a layer the status line should indicate what the problem with the layer is.
You may have to check in the error log (available in the help > about dialog) to find out more.

> The map window remains empty. The table window says "displaying
> features..." but remains empty. If I right-click to see a layer's
> properties, the status field of the summary window says:
> 
> RenderingProblem rendering: Exception rendering layer
> DefaultMapLayer[ Test, VISIBLE, UNSELECTED, style=StleImpl[ name=Default
> Styler],
> data=net.refractions.udig.project.internal.impl.UDIGFeatureStore@5fb39192, query=Query:[Request All Features]
> feature type: null
> filter: Filter.INCLUDE
> [properties: ALL]]

So the thing that worries me there is "feature type: null" - it really does not look like it was able to
understand your table.

We recently switched to a newer postgis data store internally; it is less forgiving about how you set up your tables and really
wants to make sure the postgis function add geometry column was called. Still shp2pgsql should of done that...

> I was able to display these layers with some difficulty before if I did
> not include the -s switch and set it manually after loading into Udig.

Interesting; can you confirm that your postgis contains a definition for that SRID code?

> I am having two other difficulties, perhaps related:
> 
> (1) If I load new geometry using the commandline loader, I can see the
> new tables in pgAdmin and in Udig initially, but not in the 2nd loading
> screen of Udig right before it actually loads the layers. I need to
> restart the program. Simply re-connecting to the database does not seem
> to be sufficient.

That second page in the wizard looks at the geometry columns table in postgis.
> 
> (2) It is really unclear to me when a map configuration is "saved".
> Sometimes when I close a map all the setting are kept so that when I
> restart the software, my project comes up just as before. Sometimes this
> does not happen. Is there a way to know this for certain? The "save"
> option seems always unavailable (gray).

Is should save all the time as you make changes. 

Jody



Back to the top