Image for post
Image for post

Getting Started With SpaceNet Data

Adam Van Etten
Jan 5, 2017 · 5 min read
aws s3api get-object --bucket spacenet-dataset \
--key AOI_1_Rio/processedData/processedBuildingLabels.tar.gz \
--request-payer requester processedBuildingLabels.tar.gz
Image for post
Image for post
Figure 1. SpaceNet TopCoder data directory
Image for post
Image for post
Figure 2. Random image from the SpaceNet training dataset (3band_013022223130_Public_img124.tif).
Image for post
Image for post
Figure 3. First entry of the GeoJSON label file associated with Figure 2. Here we show the first building label associated with the image; note that coordinates are stored as a WKT polygon or multipolygon with coordinates stored as [longitude, latitude, elevation]. The elevation field is always zero for this dataset.
Code snippet 1. Function to transform GeoJSON label files to an array of coordinates (both lat,lon and pixel).
Code snippet 2. Function to plot the truth coordinates for an input image.
Image for post
Image for post
Figure 3. Output of plot_truth_coords.py for a sample SpaceNet image. The left pane shows the raw 3-band image with building footprints overlaid in orange with red boundaries. The raw boundaries are shown in the right panel in red.
Code snippet 3. Function to create an image mask using the GeoJSON labels.
Image for post
Image for post
Figure 4. Output of plot_building_mask.py for two sample SpaceNet images (top and bottom rows). The left column displays the raw image with building polygons overlaid in orange. The middle column shows building outlines. The right column demonstrates the building mask created with create_building_mask.py. Note that this approach cannot differentiate the large cluster of adjacent buildings in the center left of the bottom image or the long lines of row houses in the top image. Hence if one used the mask for algorithm training data one would erroneously conclude that one large building exists at these locales rather than multiple smaller adjacent buildings.
Code snippet 4. Create the signed distance transform.
Image for post
Image for post
Figure 5. Output of plot_dist_transform.py displaying the results of create_dist_map.py for two sample SpaceNet images. The left column displays the raw image with building polygons overlaid in orange. The middle column shows the signed distance transform, with a maximum absolute value of 64 meters. The right column overlays ground truth polygons on the distance transform.
Image for post
Image for post
Figure 6. Ground truth displayed with all three transforms, from here.
Image for post
Image for post
Figure 7. Output of spacenet_explore.py, showing one of the building masks.

The DownLinQ

Welcome to the official blog of CosmiQ Works, an IQT Lab…

Adam Van Etten

Written by

The DownLinQ

Welcome to the official blog of CosmiQ Works, an IQT Lab dedicated to exploring the rapid advances delivered by artificial intelligence and geospatial startups, industry, academia, and the open source community

Adam Van Etten

Written by

The DownLinQ

Welcome to the official blog of CosmiQ Works, an IQT Lab dedicated to exploring the rapid advances delivered by artificial intelligence and geospatial startups, industry, academia, and the open source community

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store