A few years ago I was asked to rescue a project in which a municipality had spent months building a beautiful map of its water network. The geometry was perfect. But when the engineers tried to calculate the total length of pipes by diameter, the numbers made no sense. The reason, after an afternoon of detective work: the “diameter” column was stored as text, so “100” sorted before “20”, values like “approx. 150” were mixed with numbers, and empty cells were sometimes zero and sometimes blank. The shapes were fine. The attributes were a mess.
I tell this story because newcomers pay enormous attention to geometry and very little to the data that describes it. Yet in almost every project I have seen, the quality of the attributes decides the usefulness of the GIS. This guide explains the full range of spatial data types, how attributes work, which data types and measurement levels to use, and how to design tables that stay clean for years.

Two Halves of Every Piece of Spatial Data
Remember the core idea from How Does GIS Work? Layers, Data, and Analysis Explained: every feature in a GIS has a where and a what.
- The spatial component (geometry, or cell position) says where the thing is.
- The non-spatial component, the attributes, says what it is, what it is like and what has happened to it.
A road is a line (where) with a name, a surface, a speed limit and a year of construction (what). Change either half, and you change the meaning of the data. Both deserve care.
The Main Types of Spatial Data
Not all spatial data looks the same. Here are the types you will meet, from the most common to the more specialized.
1. Vector data
Features stored as explicit coordinates:
- Points: a single position. Wells, trees, incidents, addresses.
- Lines (polylines): ordered sets of points. Roads, rivers, pipelines.
- Polygons: closed rings enclosing an area. Parcels, lakes, administrative units.
- Multipart features: several separate geometries stored as one feature, such as an island nation made of many islands, or a road interrupted by a river.
2. Raster data
A regular grid of cells, each with a value: elevation, temperature, reflectance, land cover class. Rasters may have a single band or several. You can read the full comparison in Vector vs. Raster Data: The Complete Guide.
3. Triangulated irregular networks (TINs)
A surface modeled as a network of connected triangles built from irregularly spaced points. TINs adapt to terrain, using more triangles where the surface changes rapidly. They are common in engineering and terrain modeling.
4. Point clouds
Millions or billions of 3D points, usually captured by LiDAR or photogrammetry. Each point has X, Y, Z coordinates and often attributes such as intensity or classification (ground, vegetation, building). Point clouds can be turned into elevation models, building models and more.
5. Network data
Lines and junctions with connectivity rules: which roads connect at which intersections, which direction traffic may flow, how long each segment takes. It is built on vector data but adds topology for routing and tracing.
6. Tabular data with location
Tables that contain coordinates, such as a spreadsheet with latitude and longitude columns, or addresses that can be geocoded into coordinates. This is the simplest way to bring location data into a GIS.
7. Time-enabled and multidimensional data
Data that adds a time dimension: GPS tracks, satellite time series, climate model outputs, sensor streams. Formats such as NetCDF and Zarr store these multi-dimensional arrays.
8. Imagery and scanned maps
Photographs and scans that become useful once they are georeferenced: aerial photographs, orthophotos, historical maps.
Geometry Details That Matter
Even within vector data, a few properties are worth understanding.
- Dimensionality: a feature may be 2D (X, Y), include elevation (Z), or include a measure value (M) such as distance along a road. Utility and 3D data often use Z.
- Validity: polygons must be closed, must not cross themselves, and should have correct ring orientation. Invalid geometry breaks analysis.
- Precision and scale: the detail of the geometry should match the intended scale. A coastline digitized for a 1:1,000,000 map is not suitable for a harbor plan.
- Geometry type vs. layer: most file formats require one geometry type per layer. A layer of “points” can’t also hold polygons.
In spatial databases such as PostGIS, there is another distinction: the geometry type works on a flat plane in a projected system, while the geography type calculates on the curved Earth using latitude and longitude. Each has its place, and the choice affects accuracy and speed.
What Are Attributes?
Attributes are the descriptive data attached to each feature. In vector data, they live in an attribute table: each row is a feature (a record), and each column is a field that describes one property.
| ID | Name | Diameter_mm | Material | Installed | Operational |
|---|---|---|---|---|---|
| 1001 | Main Street pipe | 300 | Ductile iron | 1998-05-14 | Yes |
| 1002 | Park feeder | 150 | PVC | 2011-09-02 | Yes |
| 1003 | Old mill line | 100 | Cast iron | 1962-01-01 | No |
For rasters, the “attribute” is the cell value. Categorical rasters, such as land cover, may have a small raster attribute table that explains what each code means, and how many cells carry it.
Attribute Data Types
Every field has a data type, which tells the software what kind of values it may hold and how to treat them. Choosing correctly is half of data quality.
- Integer (short, long): whole numbers. Counts, codes, years, IDs.
- Floating point (float, double, decimal): numbers with decimals. Measurements, areas, coordinates, currency.
- Text (string, character): letters, names, descriptions, codes with leading zeros.
- Date, time and date-time: calendar values. Stored correctly, they can be sorted, filtered by period and used in time analysis.
- Boolean (yes/no): true or false.
- Binary and blob: images, documents, attachments.
- GUID / unique identifier: globally unique codes, useful in enterprise databases.
- Domain-coded values: fields restricted to a list of valid values (more on this below).
Rules of thumb for choosing
- Will you do math with it? Use a number type.
- Does it have leading zeros, like a postal code, a phone number or a parcel number? Use text, or you will lose the zeros.
- Is it a date? Use a date type, not text. Dates stored as “3/4/21” are ambiguous: March 4 or April 3?
- Is it a yes/no? Use boolean or a coded list, not free text such as “yes”, “Yes”, “Y” and “oui”.
- Is it an identifier? Use a value that is unique, permanent and meaningless, such as a sequential number. Don’t use names, which change and repeat.
Levels of Measurement: A Concept That Guides Your Maps
Statisticians classify data by what kind of information it holds. This matters in GIS because it tells you which analyses and map styles are valid.
- Nominal: categories with no order. Land use type, soil class, road type. You can count them and map them with distinct colors, but you can’t average them.
- Ordinal: categories with a meaningful order but unequal gaps. Hazard level (low, medium, high), road class (primary, secondary, tertiary). You can rank them, but the distance between steps is not defined.
- Interval: numbers with equal steps but no true zero. Temperature in Celsius, calendar year. Differences are meaningful, ratios are not (20 degrees is not “twice as warm” as 10).
- Ratio: numbers with equal steps and a true zero. Distance, area, population, income, depth. All arithmetic makes sense.
Why does this matter? Because the level of measurement determines:
- Which statistics are valid. An average of nominal codes is nonsense: a “mean land cover class of 3.4” means nothing.
- Which map style is appropriate. Use distinct colors for nominal data, ordered color ramps for ordinal and numeric data, and diverging ramps for values around a meaningful midpoint. See Cartography Principles: Designing Maps That Communicate.
A mistake I see often: land cover stored as numeric codes (1 = forest, 2 = water, 3 = urban) and then treated as numbers in a calculation. The software will happily compute an average. The result is meaningless.
Absolute and Derived Attributes
Another useful distinction:
- Stored attributes are entered or collected: name, owner, year, material.
- Derived attributes are calculated from other data: area, length, density, distance to the nearest road, and the number of points inside a polygon.
Derived values go out of date when geometry changes. A recorded “area” field that was calculated three years ago and never updated will quietly lie. Wherever possible, recalculate derived attributes with a formula or a database rule, and state the unit and the CRS used for the calculation.
Keys, Joins and Relationships
Attributes aren’t always in one table. Good databases split information across several tables and connect them with keys.
- Primary key: a field that uniquely identifies each record in a table.
- Foreign key: a field in another table that refers to that primary key.
This lets you link a layer of parcels to a table of owners, a layer of pipes to a table of inspections, or a layer of districts to a spreadsheet of statistics.
Types of relationships
- One-to-one: each feature matches exactly one record. Simple to join.
- One-to-many: one feature has many related records. One pipe, many inspections. A simple join would duplicate or lose information, so use a relationship or summarize first.
- Many-to-many: records on both sides relate to several on the other. Handled with an intermediate table.
Joins vs. relates
- A join attaches columns from one table to another permanently or temporarily, matching on a key. Best for one-to-one.
- A relate (or relationship class) keeps the tables separate but linked. Best for one-to-many.
The most common join failure comes from mismatched keys: one table stores “007” as text, the other stores 7 as a number. Always compare field types and sample values before joining.
Designing a Good Attribute Table
Here are the habits that keep tables healthy over years.
1. One fact per field, one meaning per value
Don’t cram “Diameter 150 mm, PVC” into a single text field. Make a diameter field and a material field.
2. Name fields clearly and consistently
Use short, descriptive names without spaces or special characters. Prefer pipe_diameter_mm to Diam (mm). Include the unit when it isn’t obvious. Choose a convention, such as lowercase with underscores, and stick to it.
3. Use coded values and lookup tables
Instead of letting everyone type “PVC”, “pvc”, “Pvc” or “plastic”, define a list of allowed values. In a geodatabase these are domains; in other systems, check constraints or lookup tables. This single step eliminates a huge share of data errors.
4. Treat missing values deliberately
Distinguish clearly between:
- NULL: the value is unknown or not applicable.
- Zero: a real value of zero.
- An empty string: an entered blank.
Mixing them corrupts statistics. A pipe whose diameter is unknown is not a pipe of zero millimeters. Decide your convention, and document it.
5. Store units consistently
Pick one unit per field, and write it in the field name or the data dictionary. Mixed meters and feet in one column has caused real engineering disasters.
6. Use standard formats for dates and times
Store true date fields. When text is unavoidable, use the ISO 8601 format (year-month-day, such as 2025-03-04), which is unambiguous and sorts correctly.
7. Add a unique identifier to every layer
A stable, meaningless ID makes joins, updates and tracking possible. Never recycle IDs.
8. Keep only what you need
Extra fields clutter the table and invite inconsistency. But don’t delete fields casually; others may rely on them.
9. Document every field
A data dictionary that lists each field, its meaning, type, units, allowed values and source is the difference between data that lasts and data that must be reverse-engineered. We explain it in Metadata in GIS: Why It Matters and How to Create It.
Common Attribute Problems and Their Fixes
| Problem | Typical cause | Fix |
|---|---|---|
| Numbers sort as 1, 10, 2 | Number stored as text | Convert the field to an integer or decimal type |
| Postal codes lose leading zeros | Stored as a number or opened in a spreadsheet | Store as text and import as text |
| Join leaves many empty rows | Different types or hidden spaces in keys | Match the types and trim and standardize the keys |
| Dates cannot be filtered | Dates stored as text in mixed formats | Convert to a real date field, using ISO format |
| Averages look wrong | Nominal codes treated as numbers | Treat as categories, and use counts or modes |
| Duplicate features after join | One-to-many relationship | Summarize first, or use a relationship |
| Truncated field names | Shapefile limits | Convert to GeoPackage, restoring full names |
| Empty cells counted as zero | NULL and 0 mixed | Use NULL for unknown, and handle it in queries |
A Short Checklist Before You Trust Any Dataset
- Open the attribute table and read every column header.
- Check the data type of each field.
- Look for NULLs, zeros and blanks and decide what they mean.
- Scan for inconsistent spellings and codes using unique-value lists.
- Check units and whether the values are plausible (a building 4,000 meters tall is a unit error).
- Verify the unique ID really is unique.
- Look for the date of the data and the date of the last update.
- Find the data dictionary, or write one.
Final Thoughts
Geometry is what impresses people, but attributes are what make a GIS useful. A clean attribute table, with the right types, clear names, controlled values and honest handling of missing data, lets you query, join, summarize and map with confidence. A messy one will cost you far more time than any projection problem.
Start small: open one of your layers, read every field, and ask yourself whether its type, name and values would make sense to a stranger five years from now. Fix what doesn’t. That habit is worth more than most advanced techniques.
Where to go next: read Metadata in GIS: Why It Matters and How to Create It to document your fields and data, and Shapefile vs. GeoJSON vs. GeoPackage: Which Format to Use? to choose a format that preserves them.



