12.07.2015 Views

PostGIS 1.5.8 Manual - Fedora Project Packages GIT repositories

PostGIS 1.5.8 Manual - Fedora Project Packages GIT repositories

PostGIS 1.5.8 Manual - Fedora Project Packages GIT repositories

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>PostGIS</strong> <strong>1.5.8</strong> <strong>Manual</strong>12 / 310Chapter 3Frequently Asked Questions1. I’m running PostgreSQL 9.0 and I can no longer read/view geometries in OpenJump, Safe FME, and some other tools?In PostgreSQL 9.0+, the default encoding for bytea data has been changed to hex and older JDBC drivers still assumeescape format. This has affected some applications such as Java applications using older JDBC drivers or .NET applicationsthat use the older npgsql driver that expect the old behavior of ST_AsBinary. There are two approaches togetting this to work again.You can upgrade your JDBC driver to the latest PostgreSQL 9.0 version which you can getfrom http://jdbc.postgresql.org/download.htmlIf you are running a .NET app, you can use Npgsql 2.0.11 or higher whichyou can download from http://pgfoundry.org/frs/?group_id=1000140 and as described on Francisco Figueiredo’s NpgSQL2.0.11 released blog entryIf upgrading your PostgreSQL driver is not an option, then you can set the default back to theold behavior with the following change:ALTER DATABASE mypostgisdb SET bytea_output=’escape’;2. I tried to use PgAdmin to view my geometry column and it is blank, what gives?PgAdmin doesn’t show anything for large geometries. The best ways to verify you do have day in your geometry columnsare?-- this should return no records if all your geom fields are filled inSELECT somefield FROM mytable WHERE geom IS NULL;-- To tell just how large your geometry is do a query of the form--which will tell you the most number of points you have in any of your geometrycolumnsSELECT MAX(ST_NPoints(geom)) FROM sometable;←↪3. What kind of geometric objects can I store?You can store point, line, polygon, multipoint, multiline, multipolygon, and geometrycollections. These are specified in theOpen GIS Well Known Text Format (with XYZ,XYM,XYZM extensions). There are two data types currently supported.The standard OGC geometry data type which uses a planar coordinate system for measurement and the geography datatype which uses a geodetic coordinate system. Only WGS 84 long lat (SRID:4326) is supported by the geography datatype.4. I’m all confused. Which data store should I use geometry or geography?Short Answer: geography is a new data type that supports long range distances measurements, but most computations onit are currently slower than they are on geometry. If you use geography -- you don’t need to learn much about planarcoordinate systems. Geography is generally best if all you care about is measuring distances and lengths and you havedata from all over the world. Geometry data type is an older data type that has many more functions supporting it, enjoysgreater support from third party tools, and operations on it are generally faster -- sometimes as much as 10 fold fasterfor larger geometries. Geometry is best if you are pretty comfortable with spatial reference systems or you are dealingwith localized data where all your data fits in a single spatial reference system (SRID), or you need to do a lot of spatialprocessing. Note: It is fairly easy to do one-off conversions between the two types to gain the benefits of each. Refer to

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!