Shapefile field problem

Ed McNierney ed at TOPOZONE.COM
Mon Dec 6 21:13:35 EST 2004


Abe -

Can you post the shapefile somewhere we can look at it?

The field definitions for a shapefile (DBF) are stored in a separate
header, describing each field; you can't get the field definitions from
the first record.  In fact, you can't read the first record properly
until *after* you've figured out the field definitions.

Are you creating this shapefile yourself?  Could you be creating a
defective file?  Have you tried running DBFDUMP on it?

        - Ed

Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA  01863
Phone: +1 978 251-4242   Fax: +1 978 251-1396 

-----Original Message-----
From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On
Behalf Of Abe Gillespie
Sent: Monday, December 06, 2004 8:14 PM
To: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: Re: [UMN_MAPSERVER-USERS] Shapefile field problem

It's a regular shapefile.  I think I've mostly narrowed it down.  It
seems to me (though I may be completely off) that MapServer loads the
first record of the DBF in order to get the field definitions.  If the
first record has a string field and the value is zero length it won't
give me the field (though the field count is always correct).  In
addition, it won't give me any fields after that either.  If, however, I
make sure that field has some value (a dash, an "x", whatever) then the
field definition will come in correctly.  I still haven't narrowed down
a problematic number field though.  Mind you, this is all done in
MapServer PHP v. 4.2.0.

-Abe

On Dec 6, 2004, at 6:15 PM, Daniel Morissette wrote:

> Abe Gillespie wrote:
>> A good amount of fields aren't showing up in MapServer for me.  I use

>> the following PHP script to dump out all layers and their fields for 
>> debugging.  Does MapServer have problems with certain data types or 
>> certain values in a row?
>>
>
> Are you using a tiled shapefile layer or is this a regular shapefile 
> layer?
>
> --
> ------------------------------------------------------------
>  Daniel Morissette               dmorissette at dmsolutions.ca
>  DM Solutions Group              http://www.dmsolutions.ca/
> ------------------------------------------------------------
>



More information about the mapserver-users mailing list