Skip to content

Instantly share code, notes, and snippets.

@MikeTrizna
Last active August 29, 2015 14:15
Show Gist options
  • Save MikeTrizna/418ca36b2eb5808b7b7a to your computer and use it in GitHub Desktop.
Save MikeTrizna/418ca36b2eb5808b7b7a to your computer and use it in GitHub Desktop.
GPS Fuzzing Example - IBUNAM Computer Lab
Display the source blob
Display the rendered blob
Raw
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
-99.194494,
19.320514
]
},
"properties": {
"name": "Exact location of IBUNAM computer lab (19.320514, -99.194494)",
"address": "Coyoacán, 04510 Ciudad de México, D.F., Mexico"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
-99,
19
]
},
"properties": {
"name": "Fuzzed GPS coordinates, rounded to nearest whole number: (19, -99)"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
-99.2,
19.3
]
},
"properties": {
"name": "Fuzzed GPS coordinates, rounded to nearest 10th of a degree: (19.3, -99.2)"
}
},
{
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
-99.5,
19.5
],
[
-98.5,
19.5
],
[
-98.5,
18.5
],
[
-99.5,
18.5
],
[
-99.5,
19.5
]
]
]
},
"properties": {
"name": "Fuzzed Rectangle from rounding to closest whole number"
}
},
{
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
-99.25,
19.35
],
[
-99.15,
19.35
],
[
-99.15,
19.25
],
[
-99.25,
19.25
],
[
-99.25,
19.35
]
]
]
},
"properties": {
"name": "Fuzzed Rectangle from rounding to closest 10th of a degree"
}
}
]
}
@MikeTrizna
Copy link
Author

The real "decimalLatitude" and "decimalLongitude" values of this record are 19.320514 and -99.194494, but we want to "fuzz" the coordinates to protect it. To do that, we'll use the "coordinatePrecision" field.

If we choose a "coordinatePrecision" value of "1.0 (nearest degree)", "decimalLatitude" and "decimalLongitude" become 19 and -99. This means that the specimen's coordinates have been rounded to the closest whole degree, and it could have come from anywhere in the largest rectangle.

If we choose a "coordinatePrecision" value of "0.1 (nearest 10th of a degree)", "decimalLatitude" and "decimalLongitude" become 19.3 and -99.2. This means that the specimen's coordinates have been rounded to the closest whole 10th of a degree, and it could have come from anywhere in the smaller rectangle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment