Bookmark this page: Add Help  does anybody know the format of that data  to Yahoo MyWeb Add Help  does anybody know the format of that data  to Google Bookmarks Add Help  does anybody know the format of that data  to Windows Live Add Help  does anybody know the format of that data  to Del.icio.us Digg Help  does anybody know the format of that data ! Add Help  does anybody know the format of that data  to Netscape
  •  
  • Subject
  • Author
  • Date
If you were  Registered and logged in, you could reply and use other advanced thread options
Posted by leonardo.monasterio@gmail.com on December 14, 2005, 12:46 am
Hi,

I asked for a shape file from a Brazilian government institution and
they send me a txt file. I asked them what was the format and I
received not reply. Does anybody know how to read it?

Below there is a piece of the file 10 Megabytes file.

NEWPOLY NORDSEG ORDCOORD SEGMENT X Y NEW_CODE
1 1 1 1 -164451.3 -4667.8262 "00 0000"
1 1 2 1 -164430.09 -4727.7632 "00 0000"
1 1 3 1 -164486.3 -4789.3628 "00 0000"
1 1 4 1 -164437.7 -4818.105 "00 0000"
1 1 5 1 -164435.8 -4845.814 "00 0000"
1 1 6 1 -164524.5 -4872.8169 "00 0000"

Thank you very much,
Leonardo Monasterio
Department of Geography and Economics
Federal University of Pelotas


Posted by CJT on December 14, 2005, 1:54 am
leonardo.monasterio@gmail.com wrote:

> Hi,
>
> I asked for a shape file from a Brazilian government institution and
> they send me a txt file. I asked them what was the format and I
> received not reply. Does anybody know how to read it?
>
> Below there is a piece of the file 10 Megabytes file.
>
> NEWPOLY NORDSEG ORDCOORD SEGMENT X Y NEW_CODE
> 1 1 1 1 -164451.3 -4667.8262 "00 0000"
> 1 1 2 1 -164430.09 -4727.7632 "00 0000"
> 1 1 3 1 -164486.3 -4789.3628 "00 0000"
> 1 1 4 1 -164437.7 -4818.105 "00 0000"
> 1 1 5 1 -164435.8 -4845.814 "00 0000"
> 1 1 6 1 -164524.5 -4872.8169 "00 0000"
>
> Thank you very much,
> Leonardo Monasterio
> Department of Geography and Economics
> Federal University of Pelotas
>
That looks like a delimited ASCII dump of a .dbf file to me.

--
The e-mail address in our reply-to line is reversed in an attempt to
minimize spam. Our true address is of the form che...@prodigy.net.

Posted by leonardo.monasterio@gmail.com on December 14, 2005, 1:12 pm
Thank you!.
But in fact I was expecting something like vectors. The number of
lines in the file is much higher than the number of polygons.
Any other guess?
Regards,
Leo


Posted by willem van deursen on December 15, 2005, 3:09 am
The second column might indicate point-ids of the segments of your vector. If
so, the other columns might be segment-id and polygon-id. You might want to plot
the coordinates in some plotting program (excel will do!) and see what you can
make out of the other columns. Are you sure it is polygons stored in here, or
might it be individual points?

Willem

leonardo.monasterio@gmail.com wrote:

> Thank you!.
> But in fact I was expecting something like vectors. The number of
> lines in the file is much higher than the number of polygons.
> Any other guess?
> Regards,
> Leo
>

--
Willem van Deursen, The Netherlands
wvandeursen_nospam@nospam_carthago.nl
replace _nospam@nospam_ for @ to get a valid email address
www.carthago.nl


Posted by PJ Halls on December 15, 2005, 3:25 am
Leonardo,

this is a guess, since there is really too little of the data
reproduced here to be certain. I am certain, however, that this is not
(was not) a shape file. The latter comprises at least three files, with
file types .shp, .shx and .dbf - there can also be a .shn. These have
to be used together, the .shp (binary) holding the coordinate data, the
.shx forming an index to these data, and the .dbf holding the attributes
in a dBase4 format table.

Now for what you have:

"leonardo.monasterio@gmail.com" wrote:
>
> Hi,
>
> I asked for a shape file from a Brazilian government institution and
> they send me a txt file. I asked them what was the format and I
> received not reply. Does anybody know how to read it?
>
> Below there is a piece of the file 10 Megabytes file.
>
> NEWPOLY NORDSEG ORDCOORD SEGMENT X Y NEW_CODE
> 1 1 1 1 -164451.3 -4667.8262 "00 0000"
> 1 1 2 1 -164430.09 -4727.7632 "00 0000"
> 1 1 3 1 -164486.3 -4789.3628 "00 0000"
> 1 1 4 1 -164437.7 -4818.105 "00 0000"
> 1 1 5 1 -164435.8 -4845.814 "00 0000"
> 1 1 6 1 -164524.5 -4872.8169 "00 0000"


This appears to me to be a data dump from some system that uses some
form of topology - hence my belief that this did not come from a shape
file (that holds no concept of topology). I do not recognise it,
however, as one that I have ever seen before.

I think that the x y values above are the coordinates of the *vertices*
of a line segment, that ORDCOORD indicates the position of the vertex
within the line segment identified by SEGMENT. There is too little
information to be sure what NEWPOLY and NORDSEG mean, although NEWPOLY
*may* identify the polygon for which this line segment forms part of the
boundary - but could be a flag to indicate that the data from that point
on define a new polygon. From experience of various topological
systems, NORDSEG *could* indicate the direction of the line segment, but
there is too little of the file offered to do more than guess.

NEW_CODE is likely to be an attribute value.

What I would do now is to print out enough of the file to see changes in
the values of NEWPOLY, NORDSEG and SEGMENT and then to try to plot the
coordinates by hand on a piece of graph paper, sequentially, to see what
happens. I have found this technique invaluable in understanding un or
poorly documented file formats.

Once you have determined the meanings of the fields, you should be able
to design a program that will read the file into whatever structures you
need. I find the GDAL library (GNU, Open Source) invaluable in
providing a means of writing out valid structures in a wide variety of
formats: that should enable you to write out something you can then use
in whatever tools you are using. It *might* be that the GDAL ogr2ogr
utility might understand this format already, and thus save you
programming the solution.

Best wishes,

Peter

-----------------------------------------------------------------------