Select to view content in your preferred language

How do shape files define a physical location?

5700
13
Jump to solution
05-19-2015 10:11 PM
RusselQuan
Deactivated User

How do shape files define a physical location?   When looking at the attributes of a polygon record, I see a Shape_Length and Shape_Area.  The shape can be so complex but the definition seems extremely simple.  Very curious....

0 Kudos
1 Solution

Accepted Solutions
curtvprice
MVP Alum

The Shape field in the table is a BLOB (binary large object) that has structured coordinates. The structure is different depending on the type of feature (line, polygon, point). Those locations are hidden from the interface, if you wanted to see them all you'd need to use a tool that dumps them out or write a script that can read them and print them.

Reading geometries—Help | ArcGIS for Desktop

The length and area are calculated from the shape, which can be extremely complex, with up to millions of coordinates.

View solution in original post

13 Replies
curtvprice
MVP Alum

The Shape field in the table is a BLOB (binary large object) that has structured coordinates. The structure is different depending on the type of feature (line, polygon, point). Those locations are hidden from the interface, if you wanted to see them all you'd need to use a tool that dumps them out or write a script that can read them and print them.

Reading geometries—Help | ArcGIS for Desktop

The length and area are calculated from the shape, which can be extremely complex, with up to millions of coordinates.

RusselQuan
Deactivated User

Thanks for the link - Reading Geometries.  That opens pandora's box!  I'm familiar with a BLOB as a field in and Oracle or SQL Server database.  Where is this BLOB stored?

0 Kudos
VinceAngelo
Esri Esteemed Contributor

Actually, while shapefiles have three different internal structures by type, the types are Point, Multipoint, and Polyline/Polygon. The only difference between polylines and polygons are the permitted values in the first four bytes of the shape record, and the fact that the point array values for polygon rings must close (first == last) and may not cross (though they can touch at a point).

The Shapefile Technical Description whitepaper details the nuts and bolts of the shapefile format.  Interestingly, the length and area values are not carried as properties inside the .shp file itself, but are computed when needed from the combined part and point arrays.

- V

JayantaPoddar
MVP Alum

Good one for my learning Curtis Price​.

Russel Quan​:

Hi Russel,

For a polygon, the feature stores the coordinates of the vertices that helps to define the structure of the polygon, thus calculating the area and perimeter (length), based on the projected coordinate system.



Think Location
RusselQuan
Deactivated User

Thanks.  I see the coordinate system defined in the *.prj file.  How does each shape align with the coordinate system?

0 Kudos
SepheFox
Deactivated User

Russel, each shape aligns with the coordinate system through pairs of coordinates for each vertices that match up with the coordinates in the coordinate system. If you look at that link Curtis posted, and scroll down to polygon geometries, for example, you can see illustrations of the vertices, their coordinates, and how that geometry code looks. Is that what you meant?

RusselQuan
Deactivated User

I deduce that there is a relationship between the Project Coordinate System and pairs of coordinates for a Point Geometry or a set of coordinate pairs for a Polygon Geometry that are stored in the BLOB. 

Where does that relationship get defined and how is it resolved? Ultimately, how does a polygon of a county get mapped to a polygon of a state?  And how does a point geometry of a city get mapped to a polygon of a county?

0 Kudos
SepheFox
Deactivated User

Look at this example, a .prj file that I opened in Notepad:

PROJCS["WGS 1984 UTM, Zone 36 North, Meter",GEOGCS["unnamed",DATUM["D_WGS_1984",SPHEROID["World Geodetic System of 1984",6378137.0,298.257222932867]],

PRIMEM["Greenwich",0.0],

UNIT["degree",0.0174532925199433]],

PROJECTION["Transverse_Mercator"],

PARAMETER["false_easting",500000.0],

PARAMETER["false_northing",0.0],

PARAMETER["central_meridian",33.0],

PARAMETER["scale_factor",0.9996],

PARAMETER["latitude_of_origin",0.0],

UNIT["METER",1.0]]

Then, read this description of what the parameters describe: ESRI PRJ File

In addition ArcGIS contains algorithms, or mathematical formulas, that can reproject "on the fly" a dataset in a different projection by reading it's parameters and converting them to the data frame projection.

Any clearer?

SepheFox
Deactivated User

But a point anywhere in the world, and a polygon dataset of the entire world's continents can have the exact same projection. It's not necessarily limited by scale or feature type. They are just more coordinates on the same grid of a coordinate system.

0 Kudos