# File Format Examples

### Raster Data File Formats

While [raster data](https://desktop.arcgis.com/en/arcmap/10.3/manage-data/raster-and-images/what-is-raster-data.htm) can be stored in many different formats, **GeoTIFF** is one of the most common. GeoTIFF is a standard .tif image that also contains spatial data (e.g., coordinates and projections) and attributes. In general, however, any standard image (e.g., jpeg), if given proper spatial data, a practice called [georeferencing](https://app.gitbook.com/@bcds/s/learn/tutorials/mapping-and-digital-storytelling/how-to...georectify-historical-maps-using-mapwarper), can act like a raster file.&#x20;

### Vector Data File Formats

Vector data includes data in the form of points, lines, and polygons along with any connected attributes. This type of data can come in several different formats, such as GeoJSON, CSV,  and KML. Below you can see an array of data formats (found in [Boston Open Data](https://data.boston.gov/group/geospatial)), GeoJason, CSV, KML, Shapefile, ESRI Rest API, and ArcGIS Hub Dataset. All contain the same food truck information:

![](/files/-Mgq7A-CxNS-ynpKWPUm)

While most platforms allow for some interoperability (the ability to work with several file formats), it is helpful to understand the basic distinction between them.&#x20;

#### CSV

A [CSV (comma-separated value)](https://en.wikipedia.org/wiki/Comma-separated_values) file is one of the most well-known formats for both spatial and non-spatial data and is created by using commas to separate each value of an attribute, with each line of the file equal to a single data record. If we return to thinking about [structured data sets](https://bcds.gitbook.io/handbook/digital-scholarship-methods/data/what-is-data/structured-and-unstructured-data), comma-separated value file simply puts a comma in between attribute value, returning an output that looks something like this:

![Food truck data in an "Excel" format](/files/-Mgq7IzisPR5nNoOHkF6)

![Same data as a CSV in a text editor](/files/-Mgq7KnSYqzJ1-5M9zxA)

CSV data is useful simply because it is easy to create and manipulate in software like Excel or GoogleSheets, and these programs often allow you to export your data as a CSV to make it more interoperable. It is also easy to transform a CSV file into other formats, like GeoJSON, making it an easy "go-to" for sharing spatial data

{% hint style="info" %}
CSV files are especially useful if you simply have a collection of point data. A file of this kind, sometimes called "XY data" or "long/lat data" can be easily imported into software like ArcGIS or QGIS in order to visualize it. (Note that it will not have any attributes).
{% endhint %}

#### **GeoJSON**&#x20;

[GeoJSON](https://developer.here.com/blog/an-introduction-to-geojson) is an open standard format for spatial data based on the JSON file format, which includes spatial information (points, lines, polygons) along with other qualitative and quantitative attributes. If you are using **Python**, a coding language, or platforms like **Leaflet** to manipulating spatial data, a GeoJSON export is probably your best choice.

The example below is a selection of GeoJSON data. It is organized similarly to the well-known CSV, with each feature containing a series of attributes, including (in this case) the geometry for point data, latitude, and longitude values for where the food truck will be located.&#x20;

```
{
"type": "FeatureCollection",
"name": "food_truck_schedule",
"features": [
{ "type": "Feature", "properties": { 
    "Day": "Monday", 
    "Time": "11-3pm", 
    "Truck": "Papi's Stuffed Sopapillas", 
    "Location": "Back Bay", 
    "Pinpoint": "Clarendon Street", 
    "Hours": "11-3pm", 
    "Management": "City of Boston", 
    "ObjectId": 1 }, 
    
  "geometry": {
       "type": "Point", 
       "coordinates": [ -71.0751258, 42.3505372 ] } 
 }
```

{% hint style="info" %}
It's worth noting that there are [tools](https://csvjson.com) for converting CSV to GeoJSON and vice versa.
{% endhint %}

#### KML

A [KML file (Keyhole-Markup-Language) ](https://www.ogc.org/standards/kml/)is an open standard spatial data format most commonly associated with displaying geographic data in an Earth browser such as [**Google Earth**](https://www.google.com/earth/). Although not necessarily as easily compatible with other platforms such as ArcGIS or Leaflet, there are a variety of conversion tools and plugins built-in within these platforms that may help ease the process.&#x20;

![A KML visualization of the Boston sidewalk inventory in Google Earth](/files/-Mgq7ZaxGEFUcsDOC9BZ)

#### Shapefile

A [Shapefile](https://desktop.arcgis.com/en/arcmap/10.3/manage-data/shapefiles/what-is-a-shapefile.htm) is a simple format for storing the geometric location and attribute information of geographic features represented by points, lines, or polygons (areas), and is most commonly associated with ESRI's ArcGIS program suite. From within ArcGIS/QGIS, you may then export it as other file types, though this sometimes requires purchasing the Interoperability extension.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://bcds.gitbook.io/handbook/digital-scholarship-methods/introduction-to-mapping/vector-and-raster-data/file-format-examples.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
