mirror of
https://github.com/mapbox/tippecanoe.git
synced 2025-01-22 04:18:01 +00:00
Add the feature ID filter tests
This commit is contained in:
parent
8d502eb805
commit
681907e88d
@ -30,6 +30,10 @@
|
|||||||
{ "type": "Feature", "tippecanoe": { "layer": "notlayer220442869" }, "properties": {"foo": null, "rule": "\"properties\": {\"foo\": null}, [\"==\", \"foo\", null]"}, "geometry": { "type": "Point", "coordinates": [ -100, 0 ] } }
|
{ "type": "Feature", "tippecanoe": { "layer": "notlayer220442869" }, "properties": {"foo": null, "rule": "\"properties\": {\"foo\": null}, [\"==\", \"foo\", null]"}, "geometry": { "type": "Point", "coordinates": [ -100, 0 ] } }
|
||||||
{ "type": "Feature", "tippecanoe": { "layer": "notlayer220442869" }, "properties": { "rule": "not \"properties\": {}, [\"==\", \"foo\", null]"}, "geometry": { "type": "Point", "coordinates": [ 0, 0 ] } }
|
{ "type": "Feature", "tippecanoe": { "layer": "notlayer220442869" }, "properties": { "rule": "not \"properties\": {}, [\"==\", \"foo\", null]"}, "geometry": { "type": "Point", "coordinates": [ 0, 0 ] } }
|
||||||
{ "type": "Feature", "tippecanoe": { "layer": "layer220442869" }, "properties": { "rule": "not \"properties\": {}, [\"==\", \"foo\", null]"}, "geometry": { "type": "Point", "coordinates": [ -100, 0 ] } }
|
{ "type": "Feature", "tippecanoe": { "layer": "layer220442869" }, "properties": { "rule": "not \"properties\": {}, [\"==\", \"foo\", null]"}, "geometry": { "type": "Point", "coordinates": [ -100, 0 ] } }
|
||||||
|
{ "type": "Feature", "tippecanoe": { "layer": "layer827905613" }, "id": 1234, "properties": { "rule": "\"id\": 1234, [\"==\", \"$id\", 1234]" }, "geometry": { "type": "Point", "coordinates": [ 0, 0 ] } }
|
||||||
|
{ "type": "Feature", "tippecanoe": { "layer": "notlayer827905613" }, "id": 1234, "properties": { "rule": "\"id\": 1234, [\"==\", \"$id\", 1234]" }, "geometry": { "type": "Point", "coordinates": [ -100, 0 ] } }
|
||||||
|
{ "type": "Feature", "tippecanoe": { "layer": "notlayer827905613" }, "id": "1234", "properties": { "rule": "not \"id\": \"1234\", [\"==\", \"$id\", 1234]" }, "geometry": { "type": "Point", "coordinates": [ 0, 0 ] } }
|
||||||
|
{ "type": "Feature", "tippecanoe": { "layer": "layer827905613" }, "id": "1234", "properties": { "rule": "not \"id\": \"1234\", [\"==\", \"$id\", 1234]" }, "geometry": { "type": "Point", "coordinates": [ -100, 0 ] } }
|
||||||
{ "type": "Feature", "tippecanoe": { "layer": "notlayer827905613" }, "properties": {"id": 1234, "rule": "not \"properties\": {\"id\": 1234}, [\"==\", \"$id\", 1234]"}, "geometry": { "type": "Point", "coordinates": [ 0, 0 ] } }
|
{ "type": "Feature", "tippecanoe": { "layer": "notlayer827905613" }, "properties": {"id": 1234, "rule": "not \"properties\": {\"id\": 1234}, [\"==\", \"$id\", 1234]"}, "geometry": { "type": "Point", "coordinates": [ 0, 0 ] } }
|
||||||
{ "type": "Feature", "tippecanoe": { "layer": "layer827905613" }, "properties": {"id": 1234, "rule": "not \"properties\": {\"id\": 1234}, [\"==\", \"$id\", 1234]"}, "geometry": { "type": "Point", "coordinates": [ -100, 0 ] } }
|
{ "type": "Feature", "tippecanoe": { "layer": "layer827905613" }, "properties": {"id": 1234, "rule": "not \"properties\": {\"id\": 1234}, [\"==\", \"$id\", 1234]"}, "geometry": { "type": "Point", "coordinates": [ -100, 0 ] } }
|
||||||
{ "type": "Feature", "tippecanoe": { "layer": "notlayer442294443" }, "properties": {"foo": "bar", "rule": "not \"properties\": {\"foo\": \"bar\"}, [\"!=\", \"foo\", \"bar\"]"}, "geometry": { "type": "Point", "coordinates": [ 0, 0 ] } }
|
{ "type": "Feature", "tippecanoe": { "layer": "notlayer442294443" }, "properties": {"foo": "bar", "rule": "not \"properties\": {\"foo\": \"bar\"}, [\"!=\", \"foo\", \"bar\"]"}, "geometry": { "type": "Point", "coordinates": [ 0, 0 ] } }
|
||||||
|
File diff suppressed because one or more lines are too long
@ -69,6 +69,25 @@ while (<IN>) {
|
|||||||
print GEOJSON "{ \"type\": \"Feature\", \"tippecanoe\": { \"layer\": \"not$hash\" }, $prop, \"geometry\": { \"type\": \"Point\", \"coordinates\": [ 0, 0 ] } }\n";
|
print GEOJSON "{ \"type\": \"Feature\", \"tippecanoe\": { \"layer\": \"not$hash\" }, $prop, \"geometry\": { \"type\": \"Point\", \"coordinates\": [ 0, 0 ] } }\n";
|
||||||
print GEOJSON "{ \"type\": \"Feature\", \"tippecanoe\": { \"layer\": \"$hash\" }, $prop, \"geometry\": { \"type\": \"Point\", \"coordinates\": [ -100, 0 ] } }\n";
|
print GEOJSON "{ \"type\": \"Feature\", \"tippecanoe\": { \"layer\": \"$hash\" }, $prop, \"geometry\": { \"type\": \"Point\", \"coordinates\": [ -100, 0 ] } }\n";
|
||||||
}
|
}
|
||||||
|
} elsif ($prop =~ /id/) {
|
||||||
|
$prop =~ s/id/"id"/g;
|
||||||
|
$prop =~ s/'/"/g;
|
||||||
|
|
||||||
|
my $qprop = "$prop, $filter";
|
||||||
|
$qprop =~ s/"/\\"/g;
|
||||||
|
|
||||||
|
if ($matched eq "true") {
|
||||||
|
$qprop = "\"properties\": { \"rule\": \"$qprop\" }";
|
||||||
|
|
||||||
|
print GEOJSON "{ \"type\": \"Feature\", \"tippecanoe\": { \"layer\": \"$hash\" }, $prop, $qprop, \"geometry\": { \"type\": \"Point\", \"coordinates\": [ 0, 0 ] } }\n";
|
||||||
|
print GEOJSON "{ \"type\": \"Feature\", \"tippecanoe\": { \"layer\": \"not$hash\" }, $prop, $qprop, \"geometry\": { \"type\": \"Point\", \"coordinates\": [ -100, 0 ] } }\n";
|
||||||
|
} else {
|
||||||
|
$qprop = "\"properties\": { \"rule\": \"not $qprop\" }";
|
||||||
|
|
||||||
|
print GEOJSON "{ \"type\": \"Feature\", \"tippecanoe\": { \"layer\": \"not$hash\" }, $prop, $qprop, \"geometry\": { \"type\": \"Point\", \"coordinates\": [ 0, 0 ] } }\n";
|
||||||
|
print GEOJSON "{ \"type\": \"Feature\", \"tippecanoe\": { \"layer\": \"$hash\" }, $prop, $qprop, \"geometry\": { \"type\": \"Point\", \"coordinates\": [ -100, 0 ] } }\n";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user