This commit is contained in:
Hannes Janetzek 2012-10-13 04:58:02 +02:00
parent 4a06553ddc
commit 9efe46e3ba
10 changed files with 440 additions and 1102 deletions

View File

@ -52,7 +52,8 @@ public class Tag {
*/ */
public String value; public String value;
private transient int hashCodeValue = 0; private int hashCodeValue = 0;
private final boolean intern;
/** /**
* @param tag * @param tag
@ -66,18 +67,7 @@ public class Tag {
} }
this.key = tag.substring(0, splitPosition).intern(); this.key = tag.substring(0, splitPosition).intern();
this.value = tag.substring(splitPosition + 1).intern(); this.value = tag.substring(splitPosition + 1).intern();
} this.intern = true;
public Tag(String tag, boolean hashValue) {
int splitPosition = tag.indexOf(KEY_VALUE_SEPARATOR);
if (splitPosition < 0) {
System.out.println("TAG:" + tag);
}
this.key = tag.substring(0, splitPosition).intern();
if (!hashValue)
this.value = tag.substring(splitPosition + 1);
else
this.value = tag.substring(splitPosition + 1).intern();
} }
/** /**
@ -89,6 +79,7 @@ public class Tag {
public Tag(String key, String value) { public Tag(String key, String value) {
this.key = (key == null ? null : key.intern()); this.key = (key == null ? null : key.intern());
this.value = (value == null ? null : value.intern()); this.value = (value == null ? null : value.intern());
this.intern = true;
} }
/** /**
@ -108,6 +99,7 @@ public class Tag {
this.key = key; this.key = key;
this.value = value; this.value = value;
} }
this.intern = intern;
} }
@Override @Override
@ -119,9 +111,13 @@ public class Tag {
} }
Tag other = (Tag) obj; Tag other = (Tag) obj;
if ((this.key == other.key) && (this.value == other.value)) if (this.intern && other.intern) {
return true; if ((this.key == other.key) && (this.value == other.value))
return true;
} else {
if ((this.key.equals(other.key)) && (this.value.equals(other.value)))
return true;
}
return false; return false;
} }

View File

@ -22,10 +22,10 @@ final class QueryCalculations {
if (tile.tileX % 2 == 0 && tile.tileY % 2 == 0) { if (tile.tileX % 2 == 0 && tile.tileY % 2 == 0) {
// upper left quadrant // upper left quadrant
return 0xcc00; return 0xcc00;
} else if (tile.tileX % 2 == 1 && tile.tileY % 2 == 0) { } else if ((tile.tileX & 1) == 1 && tile.tileY % 2 == 0) {
// upper right quadrant // upper right quadrant
return 0x3300; return 0x3300;
} else if (tile.tileX % 2 == 0 && tile.tileY % 2 == 1) { } else if (tile.tileX % 2 == 0 && (tile.tileY & 1) == 1) {
// lower left quadrant // lower left quadrant
return 0xcc; return 0xcc;
} else { } else {
@ -98,14 +98,18 @@ final class QueryCalculations {
} }
} }
static void calculateBaseTiles(QueryParameters queryParameters, Tile tile, SubFileParameter subFileParameter) { static void calculateBaseTiles(QueryParameters queryParameters, Tile tile,
SubFileParameter subFileParameter) {
if (tile.zoomLevel < subFileParameter.baseZoomLevel) { if (tile.zoomLevel < subFileParameter.baseZoomLevel) {
// calculate the XY numbers of the upper left and lower right sub-tiles // calculate the XY numbers of the upper left and lower right
// sub-tiles
int zoomLevelDifference = subFileParameter.baseZoomLevel - tile.zoomLevel; int zoomLevelDifference = subFileParameter.baseZoomLevel - tile.zoomLevel;
queryParameters.fromBaseTileX = tile.tileX << zoomLevelDifference; queryParameters.fromBaseTileX = tile.tileX << zoomLevelDifference;
queryParameters.fromBaseTileY = tile.tileY << zoomLevelDifference; queryParameters.fromBaseTileY = tile.tileY << zoomLevelDifference;
queryParameters.toBaseTileX = queryParameters.fromBaseTileX + (1 << zoomLevelDifference) - 1; queryParameters.toBaseTileX = queryParameters.fromBaseTileX
queryParameters.toBaseTileY = queryParameters.fromBaseTileY + (1 << zoomLevelDifference) - 1; + (1 << zoomLevelDifference) - 1;
queryParameters.toBaseTileY = queryParameters.fromBaseTileY
+ (1 << zoomLevelDifference) - 1;
queryParameters.useTileBitmask = false; queryParameters.useTileBitmask = false;
} else if (tile.zoomLevel > subFileParameter.baseZoomLevel) { } else if (tile.zoomLevel > subFileParameter.baseZoomLevel) {
// calculate the XY numbers of the parent base tile // calculate the XY numbers of the parent base tile
@ -128,11 +132,15 @@ final class QueryCalculations {
static void calculateBlocks(QueryParameters queryParameters, SubFileParameter subFileParameter) { static void calculateBlocks(QueryParameters queryParameters, SubFileParameter subFileParameter) {
// calculate the blocks in the file which need to be read // calculate the blocks in the file which need to be read
queryParameters.fromBlockX = Math.max(queryParameters.fromBaseTileX - subFileParameter.boundaryTileLeft, 0); queryParameters.fromBlockX = Math.max(queryParameters.fromBaseTileX
queryParameters.fromBlockY = Math.max(queryParameters.fromBaseTileY - subFileParameter.boundaryTileTop, 0); - subFileParameter.boundaryTileLeft, 0);
queryParameters.toBlockX = Math.min(queryParameters.toBaseTileX - subFileParameter.boundaryTileLeft, queryParameters.fromBlockY = Math.max(queryParameters.fromBaseTileY
- subFileParameter.boundaryTileTop, 0);
queryParameters.toBlockX = Math.min(queryParameters.toBaseTileX
- subFileParameter.boundaryTileLeft,
subFileParameter.blocksWidth - 1); subFileParameter.blocksWidth - 1);
queryParameters.toBlockY = Math.min(queryParameters.toBaseTileY - subFileParameter.boundaryTileTop, queryParameters.toBlockY = Math.min(queryParameters.toBaseTileY
- subFileParameter.boundaryTileTop,
subFileParameter.blocksHeight - 1); subFileParameter.blocksHeight - 1);
} }

View File

@ -403,8 +403,9 @@ public class MapDatabase implements IMapDatabase {
} }
if (fail || tags == null || indexCnt == 0) { if (fail || tags == null || indexCnt == 0) {
Log.d(TAG, "failed reading way: bytes:" + bytes + " index:" + index + " tag:" Log.d(TAG, "failed reading way: bytes:" + bytes + " index:"
+ (tags != null ? tags[0] : "...") + " " + (index == null ? "null" : index.toString()) + " tag:"
+ (tags != null ? tags.toString() : "...") + " "
+ indexCnt + " " + coordCnt); + indexCnt + " " + coordCnt);
return false; return false;
} }

View File

@ -523,8 +523,9 @@ public class MapDatabase implements IMapDatabase {
} }
if (fail || index == null || tags == null || indexCnt == 0 || tagCnt == 0) { if (fail || index == null || tags == null || indexCnt == 0 || tagCnt == 0) {
Log.d(TAG, "failed reading way: bytes:" + bytes + " index:" + index + " tag:" Log.d(TAG, "failed reading way: bytes:" + bytes + " index:"
+ (tags != null ? tags[0] : "...") + " " + (index == null ? "null" : index.toString()) + " tag:"
+ (tags != null ? tags.toString() : "...") + " "
+ indexCnt + " " + coordCnt + " " + tagCnt); + indexCnt + " " + coordCnt + " " + tagCnt);
return false; return false;
} }
@ -943,8 +944,7 @@ public class MapDatabase implements IMapDatabase {
return result; return result;
} }
// ///////////////////////// Lightweight HttpClient // ///////////////////////// Lightweight HttpClient //////////////////////
// ///////////////////////////////////////
// would have written simple tcp server/client for this... // would have written simple tcp server/client for this...
private int mMaxReq = 0; private int mMaxReq = 0;

View File

@ -582,377 +582,377 @@ public class Tags {
public static final Tag[] tags = { public static final Tag[] tags = {
new Tag(s_building, s_yes, true), new Tag(s_highway, s_residential, true), new Tag(s_building, s_yes, false), new Tag(s_highway, s_residential, false),
new Tag(s_highway, s_service, true), new Tag(s_waterway, s_stream, true), new Tag(s_highway, s_service, false), new Tag(s_waterway, s_stream, false),
new Tag(s_highway, s_unclassified, true), new Tag(s_highway, s_track, true), new Tag(s_highway, s_unclassified, false), new Tag(s_highway, s_track, false),
new Tag(s_oneway, s_yes, true), new Tag(s_natural, s_water, true), new Tag(s_oneway, s_yes, false), new Tag(s_natural, s_water, false),
new Tag(s_highway, s_footway, true), new Tag(s_access, s_private, true), new Tag(s_highway, s_footway, false), new Tag(s_access, s_private, false),
new Tag(s_highway, s_tertiary, true), new Tag(s_highway, s_path, true), new Tag(s_highway, s_tertiary, false), new Tag(s_highway, s_path, false),
new Tag(s_highway, s_secondary, true), new Tag(s_landuse, s_forest, true), new Tag(s_highway, s_secondary, false), new Tag(s_landuse, s_forest, false),
new Tag(s_bridge, s_yes, true), new Tag(s_natural, s_tree, true), new Tag(s_bridge, s_yes, false), new Tag(s_natural, s_tree, false),
new Tag(s_surface, s_paved, true), new Tag(s_natural, s_wood, true), new Tag(s_surface, s_paved, false), new Tag(s_natural, s_wood, false),
new Tag(s_highway, s_primary, true), new Tag(s_landuse, s_grass, true), new Tag(s_highway, s_primary, false), new Tag(s_landuse, s_grass, false),
new Tag(s_landuse, s_residential, true), new Tag(s_surface, s_unpaved, true), new Tag(s_landuse, s_residential, false), new Tag(s_surface, s_unpaved, false),
new Tag(s_highway, s_bus_stop, true), new Tag(s_surface, s_asphalt, true), new Tag(s_highway, s_bus_stop, false), new Tag(s_surface, s_asphalt, false),
new Tag(s_bicycle, s_yes, true), new Tag(s_amenity, s_parking, true), new Tag(s_bicycle, s_yes, false), new Tag(s_amenity, s_parking, false),
new Tag(s_place, s_locality, true), new Tag(s_railway, s_rail, true), new Tag(s_place, s_locality, false), new Tag(s_railway, s_rail, false),
new Tag(s_service, s_parking_aisle, true), new Tag(s_service, s_parking_aisle, false),
new Tag(s_boundary, s_administrative, true), new Tag(s_boundary, s_administrative, false),
new Tag(s_building, s_house, true), new Tag(s_place, s_village, true), new Tag(s_building, s_house, false), new Tag(s_place, s_village, false),
new Tag(s_natural, s_coastline, true), new Tag(s_tracktype, s_grade2, true), new Tag(s_natural, s_coastline, false), new Tag(s_tracktype, s_grade2, false),
new Tag(s_oneway, s_no, true), new Tag(s_service, s_driveway, true), new Tag(s_oneway, s_no, false), new Tag(s_service, s_driveway, false),
new Tag(s_highway, s_turning_circle, true), new Tag(s_place, s_hamlet, true), new Tag(s_highway, s_turning_circle, false), new Tag(s_place, s_hamlet, false),
new Tag(s_natural, s_wetland, true), new Tag(s_tracktype, s_grade3, true), new Tag(s_natural, s_wetland, false), new Tag(s_tracktype, s_grade3, false),
new Tag(s_waterway, s_river, true), new Tag(s_highway, s_cycleway, true), new Tag(s_waterway, s_river, false), new Tag(s_highway, s_cycleway, false),
new Tag(s_barrier, s_fence, true), new Tag(s_building, s_residential, true), new Tag(s_barrier, s_fence, false), new Tag(s_building, s_residential, false),
new Tag(s_amenity, s_school, true), new Tag(s_highway, s_crossing, true), new Tag(s_amenity, s_school, false), new Tag(s_highway, s_crossing, false),
new Tag(s_admin_level, s_8, true), new Tag(s_highway, s_trunk, true), new Tag(s_admin_level, s_8, false), new Tag(s_highway, s_trunk, false),
new Tag(s_amenity, s_place_of_worship, true), new Tag(s_amenity, s_place_of_worship, false),
new Tag(s_landuse, s_farmland, true), new Tag(s_tracktype, s_grade1, true), new Tag(s_landuse, s_farmland, false), new Tag(s_tracktype, s_grade1, false),
new Tag(s_highway, s_road, true), new Tag(s_landuse, s_farm, true), new Tag(s_highway, s_road, false), new Tag(s_landuse, s_farm, false),
new Tag(s_surface, s_gravel, true), new Tag(s_landuse, s_meadow, true), new Tag(s_surface, s_gravel, false), new Tag(s_landuse, s_meadow, false),
new Tag(s_highway, s_motorway, true), new Tag(s_highway, s_motorway, false),
new Tag(s_highway, s_traffic_signals, true), new Tag(s_highway, s_traffic_signals, false),
new Tag(s_building, s_hut, true), new Tag(s_highway, s_motorway_link, true), new Tag(s_building, s_hut, false), new Tag(s_highway, s_motorway_link, false),
new Tag(s_tracktype, s_grade4, true), new Tag(s_barrier, s_gate, true), new Tag(s_tracktype, s_grade4, false), new Tag(s_barrier, s_gate, false),
new Tag(s_highway, s_living_street, true), new Tag(s_bicycle, s_no, true), new Tag(s_highway, s_living_street, false), new Tag(s_bicycle, s_no, false),
new Tag(s_leisure, s_pitch, true), new Tag(s_tunnel, s_yes, true), new Tag(s_leisure, s_pitch, false), new Tag(s_tunnel, s_yes, false),
new Tag(s_surface, s_ground, true), new Tag(s_highway, s_steps, true), new Tag(s_surface, s_ground, false), new Tag(s_highway, s_steps, false),
new Tag(s_natural, s_land, true), new Tag(s_man_made, s_survey_point, true), new Tag(s_natural, s_land, false), new Tag(s_man_made, s_survey_point, false),
new Tag(s_tracktype, s_grade5, true), new Tag(s_waterway, s_ditch, true), new Tag(s_tracktype, s_grade5, false), new Tag(s_waterway, s_ditch, false),
new Tag(s_leisure, s_park, true), new Tag(s_amenity, s_restaurant, true), new Tag(s_leisure, s_park, false), new Tag(s_amenity, s_restaurant, false),
new Tag(s_barrier, s_wall, true), new Tag(s_waterway, s_riverbank, true), new Tag(s_barrier, s_wall, false), new Tag(s_waterway, s_riverbank, false),
new Tag(s_amenity, s_bench, true), new Tag(s_building, s_garage, true), new Tag(s_amenity, s_bench, false), new Tag(s_building, s_garage, false),
new Tag(s_natural, s_scrub, true), new Tag(s_highway, s_pedestrian, true), new Tag(s_natural, s_scrub, false), new Tag(s_highway, s_pedestrian, false),
new Tag(s_natural, s_peak, true), new Tag(s_building, s_entrance, true), new Tag(s_natural, s_peak, false), new Tag(s_building, s_entrance, false),
new Tag(s_landuse, s_reservoir, true), new Tag(s_access, s_yes, true), new Tag(s_landuse, s_reservoir, false), new Tag(s_access, s_yes, false),
new Tag(s_bicycle, s_designated, true), new Tag(s_bicycle, s_designated, false),
new Tag(s_leisure, s_swimming_pool, true), new Tag(s_leisure, s_swimming_pool, false),
new Tag(s_landuse, s_farmyard, true), new Tag(s_landuse, s_farmyard, false),
new Tag(s_railway, s_level_crossing, true), new Tag(s_railway, s_level_crossing, false),
new Tag(s_building, s_apartments, true), new Tag(s_surface, s_grass, true), new Tag(s_building, s_apartments, false), new Tag(s_surface, s_grass, false),
new Tag(s_wheelchair, s_yes, true), new Tag(s_service, s_alley, true), new Tag(s_wheelchair, s_yes, false), new Tag(s_service, s_alley, false),
new Tag(s_landuse, s_industrial, true), new Tag(s_amenity, s_fuel, true), new Tag(s_landuse, s_industrial, false), new Tag(s_amenity, s_fuel, false),
new Tag(s_surface, s_dirt, true), new Tag(s_highway, s_trunk_link, true), new Tag(s_surface, s_dirt, false), new Tag(s_highway, s_trunk_link, false),
new Tag(s_waterway, s_drain, true), new Tag(s_barrier, s_hedge, true), new Tag(s_waterway, s_drain, false), new Tag(s_barrier, s_hedge, false),
new Tag(s_amenity, s_grave_yard, true), new Tag(s_amenity, s_grave_yard, false),
new Tag(s_tourism, s_information, true), new Tag(s_tourism, s_information, false),
new Tag(s_shop, s_supermarket, true), new Tag(s_shop, s_supermarket, false),
new Tag(s_highway, s_primary_link, true), new Tag(s_wood, s_deciduous, true), new Tag(s_highway, s_primary_link, false), new Tag(s_wood, s_deciduous, false),
new Tag(s_leisure, s_playground, true), new Tag(s_building, s_roof, true), new Tag(s_leisure, s_playground, false), new Tag(s_building, s_roof, false),
new Tag(s_building, s_industrial, true), new Tag(s_building, s_industrial, false),
new Tag(s_amenity, s_post_box, true), new Tag(s_waterway, s_canal, true), new Tag(s_amenity, s_post_box, false), new Tag(s_waterway, s_canal, false),
new Tag(s_barrier, s_bollard, true), new Tag(s_leisure, s_garden, true), new Tag(s_barrier, s_bollard, false), new Tag(s_leisure, s_garden, false),
new Tag(s_wood, s_mixed, true), new Tag(s_landuse, s_cemetery, true), new Tag(s_wood, s_mixed, false), new Tag(s_landuse, s_cemetery, false),
new Tag(s_landuse, s_orchard, true), new Tag(s_shop, s_convenience, true), new Tag(s_landuse, s_orchard, false), new Tag(s_shop, s_convenience, false),
new Tag(s_access, s_permissive, true), new Tag(s_surface, s_concrete, true), new Tag(s_access, s_permissive, false), new Tag(s_surface, s_concrete, false),
new Tag(s_surface, s_paving_stones, true), new Tag(s_service, s_spur, true), new Tag(s_surface, s_paving_stones, false), new Tag(s_service, s_spur, false),
new Tag(s_building, s_garages, true), new Tag(s_amenity, s_bank, true), new Tag(s_building, s_garages, false), new Tag(s_amenity, s_bank, false),
new Tag(s_tourism, s_hotel, true), new Tag(s_access, s_no, true), new Tag(s_tourism, s_hotel, false), new Tag(s_access, s_no, false),
new Tag(s_amenity, s_fast_food, true), new Tag(s_man_made, s_pier, true), new Tag(s_amenity, s_fast_food, false), new Tag(s_man_made, s_pier, false),
new Tag(s_amenity, s_kindergarten, true), new Tag(s_amenity, s_kindergarten, false),
new Tag(s_access, s_agricultural, true), new Tag(s_access, s_agricultural, false),
new Tag(s_surface, s_cobblestone, true), new Tag(s_wheelchair, s_no, true), new Tag(s_surface, s_cobblestone, false), new Tag(s_wheelchair, s_no, false),
new Tag(s_amenity, s_cafe, true), new Tag(s_amenity, s_hospital, true), new Tag(s_amenity, s_cafe, false), new Tag(s_amenity, s_hospital, false),
new Tag(s_amenity, s_post_office, true), new Tag(s_amenity, s_post_office, false),
new Tag(s_amenity, s_public_building, true), new Tag(s_amenity, s_public_building, false),
new Tag(s_amenity, s_recycling, true), new Tag(s_amenity, s_recycling, false),
new Tag(s_highway, s_street_lamp, true), new Tag(s_man_made, s_tower, true), new Tag(s_highway, s_street_lamp, false), new Tag(s_man_made, s_tower, false),
new Tag(s_waterway, s_dam, true), new Tag(s_amenity, s_pub, true), new Tag(s_waterway, s_dam, false), new Tag(s_amenity, s_pub, false),
new Tag(s_wood, s_coniferous, true), new Tag(s_access, s_destination, true), new Tag(s_wood, s_coniferous, false), new Tag(s_access, s_destination, false),
new Tag(s_admin_level, s_6, true), new Tag(s_landuse, s_commercial, true), new Tag(s_admin_level, s_6, false), new Tag(s_landuse, s_commercial, false),
new Tag(s_amenity, s_pharmacy, true), new Tag(s_railway, s_abandoned, true), new Tag(s_amenity, s_pharmacy, false), new Tag(s_railway, s_abandoned, false),
new Tag(s_service, s_yard, true), new Tag(s_place, s_island, true), new Tag(s_service, s_yard, false), new Tag(s_place, s_island, false),
new Tag(s_oneway, s__1, true), new Tag(s_landuse, s_quarry, true), new Tag(s_oneway, s__1, false), new Tag(s_landuse, s_quarry, false),
new Tag(s_landuse, s_vineyard, true), new Tag(s_landuse, s_vineyard, false),
new Tag(s_highway, s_motorway_junction, true), new Tag(s_highway, s_motorway_junction, false),
new Tag(s_railway, s_station, true), new Tag(s_landuse, s_allotments, true), new Tag(s_railway, s_station, false), new Tag(s_landuse, s_allotments, false),
new Tag(s_barrier, s_lift_gate, true), new Tag(s_admin_level, s_10, true), new Tag(s_barrier, s_lift_gate, false), new Tag(s_admin_level, s_10, false),
new Tag(s_amenity, s_telephone, true), new Tag(s_place, s_town, true), new Tag(s_amenity, s_telephone, false), new Tag(s_place, s_town, false),
new Tag(s_man_made, s_cutline, true), new Tag(s_place, s_suburb, true), new Tag(s_man_made, s_cutline, false), new Tag(s_place, s_suburb, false),
new Tag(s_aeroway, s_taxiway, true), new Tag(s_wheelchair, s_limited, true), new Tag(s_aeroway, s_taxiway, false), new Tag(s_wheelchair, s_limited, false),
new Tag(s_highway, s_secondary_link, true), new Tag(s_highway, s_secondary_link, false),
new Tag(s_leisure, s_sports_centre, true), new Tag(s_leisure, s_sports_centre, false),
new Tag(s_amenity, s_bicycle_parking, true), new Tag(s_amenity, s_bicycle_parking, false),
new Tag(s_surface, s_sand, true), new Tag(s_highway, s_stop, true), new Tag(s_surface, s_sand, false), new Tag(s_highway, s_stop, false),
new Tag(s_man_made, s_works, true), new Tag(s_landuse, s_retail, true), new Tag(s_man_made, s_works, false), new Tag(s_landuse, s_retail, false),
new Tag(s_amenity, s_fire_station, true), new Tag(s_service, s_siding, true), new Tag(s_amenity, s_fire_station, false), new Tag(s_service, s_siding, false),
new Tag(s_amenity, s_toilets, true), new Tag(s_bench, s_yes, true), new Tag(s_amenity, s_toilets, false), new Tag(s_bench, s_yes, false),
new Tag(s_oneway, s_1, true), new Tag(s_surface, s_compacted, true), new Tag(s_oneway, s_1, false), new Tag(s_surface, s_compacted, false),
new Tag(s_landuse, s_basin, true), new Tag(s_amenity, s_police, true), new Tag(s_landuse, s_basin, false), new Tag(s_amenity, s_police, false),
new Tag(s_railway, s_tram, true), new Tag(s_route, s_road, true), new Tag(s_railway, s_tram, false), new Tag(s_route, s_road, false),
new Tag(s_natural, s_cliff, true), new Tag(s_highway, s_construction, true), new Tag(s_natural, s_cliff, false), new Tag(s_highway, s_construction, false),
new Tag(s_aeroway, s_aerodrome, true), new Tag(s_entrance, s_yes, true), new Tag(s_aeroway, s_aerodrome, false), new Tag(s_entrance, s_yes, false),
new Tag(s_man_made, s_storage_tank, true), new Tag(s_amenity, s_atm, true), new Tag(s_man_made, s_storage_tank, false), new Tag(s_amenity, s_atm, false),
new Tag(s_tourism, s_attraction, true), new Tag(s_route, s_bus, true), new Tag(s_tourism, s_attraction, false), new Tag(s_route, s_bus, false),
new Tag(s_shop, s_bakery, true), new Tag(s_tourism, s_viewpoint, true), new Tag(s_shop, s_bakery, false), new Tag(s_tourism, s_viewpoint, false),
new Tag(s_amenity, s_swimming_pool, true), new Tag(s_natural, s_beach, true), new Tag(s_amenity, s_swimming_pool, false), new Tag(s_natural, s_beach, false),
new Tag(s_tourism, s_picnic_site, true), new Tag(s_oneway, s_true, true), new Tag(s_tourism, s_picnic_site, false), new Tag(s_oneway, s_true, false),
new Tag(s_highway, s_bridleway, true), new Tag(s_tourism, s_camp_site, true), new Tag(s_highway, s_bridleway, false), new Tag(s_tourism, s_camp_site, false),
new Tag(s_abutters, s_residential, true), new Tag(s_abutters, s_residential, false),
new Tag(s_leisure, s_nature_reserve, true), new Tag(s_leisure, s_nature_reserve, false),
new Tag(s_amenity, s_drinking_water, true), new Tag(s_shop, s_clothes, true), new Tag(s_amenity, s_drinking_water, false), new Tag(s_shop, s_clothes, false),
new Tag(s_natural, s_heath, true), new Tag(s_natural, s_heath, false),
new Tag(s_highway, s_mini_roundabout, true), new Tag(s_highway, s_mini_roundabout, false),
new Tag(s_landuse, s_construction, true), new Tag(s_landuse, s_construction, false),
new Tag(s_amenity, s_waste_basket, true), new Tag(s_amenity, s_waste_basket, false),
new Tag(s_railway, s_platform, true), new Tag(s_amenity, s_townhall, true), new Tag(s_railway, s_platform, false), new Tag(s_amenity, s_townhall, false),
new Tag(s_shop, s_hairdresser, true), new Tag(s_amenity, s_shelter, true), new Tag(s_shop, s_hairdresser, false), new Tag(s_amenity, s_shelter, false),
new Tag(s_admin_level, s_9, true), new Tag(s_admin_level, s_9, false),
new Tag(s_building, s_farm_auxiliary, true), new Tag(s_building, s_farm_auxiliary, false),
new Tag(s_amenity, s_library, true), new Tag(s_building, s_detached, true), new Tag(s_amenity, s_library, false), new Tag(s_building, s_detached, false),
new Tag(s_admin_level, s_4, true), new Tag(s_landuse, s_village_green, true), new Tag(s_admin_level, s_4, false), new Tag(s_landuse, s_village_green, false),
new Tag(s_barrier, s_stile, true), new Tag(s_landuse, s_garages, true), new Tag(s_barrier, s_stile, false), new Tag(s_landuse, s_garages, false),
new Tag(s_amenity, s_bar, true), new Tag(s_railway, s_buffer_stop, true), new Tag(s_amenity, s_bar, false), new Tag(s_railway, s_buffer_stop, false),
new Tag(s_wetland, s_marsh, true), new Tag(s_tourism, s_museum, true), new Tag(s_wetland, s_marsh, false), new Tag(s_tourism, s_museum, false),
new Tag(s_barrier, s_cycle_barrier, true), new Tag(s_route, s_bicycle, true), new Tag(s_barrier, s_cycle_barrier, false), new Tag(s_route, s_bicycle, false),
new Tag(s_railway, s_tram_stop, true), new Tag(s_railway, s_tram_stop, false),
new Tag(s_amenity, s_parking_space, true), new Tag(s_amenity, s_parking_space, false),
new Tag(s_barrier, s_retaining_wall, true), new Tag(s_barrier, s_retaining_wall, false),
new Tag(s_landuse, s_recreation_ground, true), new Tag(s_landuse, s_recreation_ground, false),
new Tag(s_amenity, s_university, true), new Tag(s_amenity, s_university, false),
new Tag(s_highway, s_tertiary_link, true), new Tag(s_highway, s_tertiary_link, false),
new Tag(s_building, s_terrace, true), new Tag(s_shop, s_car_repair, true), new Tag(s_building, s_terrace, false), new Tag(s_shop, s_car_repair, false),
new Tag(s_amenity, s_hunting_stand, true), new Tag(s_amenity, s_hunting_stand, false),
new Tag(s_amenity, s_fountain, true), new Tag(s_man_made, s_pipeline, true), new Tag(s_amenity, s_fountain, false), new Tag(s_man_made, s_pipeline, false),
new Tag(s_wetland, s_swamp, true), new Tag(s_shop, s_car, true), new Tag(s_wetland, s_swamp, false), new Tag(s_shop, s_car, false),
new Tag(s_bench, s_no, true), new Tag(s_tunnel, s_culvert, true), new Tag(s_bench, s_no, false), new Tag(s_tunnel, s_culvert, false),
new Tag(s_building, s_school, true), new Tag(s_barrier, s_entrance, true), new Tag(s_building, s_school, false), new Tag(s_barrier, s_entrance, false),
new Tag(s_railway, s_disused, true), new Tag(s_railway, s_crossing, true), new Tag(s_railway, s_disused, false), new Tag(s_railway, s_crossing, false),
new Tag(s_building, s_church, true), new Tag(s_building, s_church, false),
new Tag(s_amenity, s_social_facility, true), new Tag(s_natural, s_bay, true), new Tag(s_amenity, s_social_facility, false), new Tag(s_natural, s_bay, false),
new Tag(s_shop, s_kiosk, true), new Tag(s_amenity, s_vending_machine, true), new Tag(s_shop, s_kiosk, false), new Tag(s_amenity, s_vending_machine, false),
new Tag(s_route, s_hiking, true), new Tag(s_natural, s_spring, true), new Tag(s_route, s_hiking, false), new Tag(s_natural, s_spring, false),
new Tag(s_leisure, s_common, true), new Tag(s_railway, s_switch, true), new Tag(s_leisure, s_common, false), new Tag(s_railway, s_switch, false),
new Tag(s_waterway, s_rapids, true), new Tag(s_admin_level, s_7, true), new Tag(s_waterway, s_rapids, false), new Tag(s_admin_level, s_7, false),
new Tag(s_leisure, s_stadium, true), new Tag(s_leisure, s_track, true), new Tag(s_leisure, s_stadium, false), new Tag(s_leisure, s_track, false),
new Tag(s_place, s_isolated_dwelling, true), new Tag(s_place, s_islet, true), new Tag(s_place, s_isolated_dwelling, false), new Tag(s_place, s_islet, false),
new Tag(s_waterway, s_weir, true), new Tag(s_amenity, s_doctors, true), new Tag(s_waterway, s_weir, false), new Tag(s_amenity, s_doctors, false),
new Tag(s_access, s_designated, true), new Tag(s_access, s_designated, false),
new Tag(s_landuse, s_conservation, true), new Tag(s_landuse, s_conservation, false),
new Tag(s_waterway, s_artificial, true), new Tag(s_waterway, s_artificial, false),
new Tag(s_amenity, s_bus_station, true), new Tag(s_amenity, s_bus_station, false),
new Tag(s_leisure, s_golf_course, true), new Tag(s_leisure, s_golf_course, false),
new Tag(s_shop, s_doityourself, true), new Tag(s_building, s_service, true), new Tag(s_shop, s_doityourself, false), new Tag(s_building, s_service, false),
new Tag(s_tourism, s_guest_house, true), new Tag(s_aeroway, s_runway, true), new Tag(s_tourism, s_guest_house, false), new Tag(s_aeroway, s_runway, false),
new Tag(s_place, s_city, true), new Tag(s_railway, s_subway, true), new Tag(s_place, s_city, false), new Tag(s_railway, s_subway, false),
new Tag(s_man_made, s_wastewater_plant, true), new Tag(s_man_made, s_wastewater_plant, false),
new Tag(s_building, s_commercial, true), new Tag(s_railway, s_halt, true), new Tag(s_building, s_commercial, false), new Tag(s_railway, s_halt, false),
new Tag(s_amenity, s_emergency_phone, true), new Tag(s_amenity, s_emergency_phone, false),
new Tag(s_building, s_retail, true), new Tag(s_barrier, s_block, true), new Tag(s_building, s_retail, false), new Tag(s_barrier, s_block, false),
new Tag(s_leisure, s_recreation_ground, true), new Tag(s_leisure, s_recreation_ground, false),
new Tag(s_access, s_forestry, true), new Tag(s_amenity, s_college, true), new Tag(s_access, s_forestry, false), new Tag(s_amenity, s_college, false),
new Tag(s_highway, s_platform, true), new Tag(s_access, s_unknown, true), new Tag(s_highway, s_platform, false), new Tag(s_access, s_unknown, false),
new Tag(s_man_made, s_water_tower, true), new Tag(s_man_made, s_water_tower, false),
new Tag(s_surface, s_pebblestone, true), new Tag(s_bridge, s_viaduct, true), new Tag(s_surface, s_pebblestone, false), new Tag(s_bridge, s_viaduct, false),
new Tag(s_shop, s_butcher, true), new Tag(s_shop, s_florist, true), new Tag(s_shop, s_butcher, false), new Tag(s_shop, s_florist, false),
new Tag(s_boundary, s_landuse, true), new Tag(s_aeroway, s_helipad, true), new Tag(s_boundary, s_landuse, false), new Tag(s_aeroway, s_helipad, false),
new Tag(s_building, s_hangar, true), new Tag(s_natural, s_glacier, true), new Tag(s_building, s_hangar, false), new Tag(s_natural, s_glacier, false),
new Tag(s_highway, s_proposed, true), new Tag(s_shop, s_mall, true), new Tag(s_highway, s_proposed, false), new Tag(s_shop, s_mall, false),
new Tag(s_barrier, s_toll_booth, true), new Tag(s_barrier, s_toll_booth, false),
new Tag(s_amenity, s_fire_hydrant, true), new Tag(s_amenity, s_fire_hydrant, false),
new Tag(s_building, s_manufacture, true), new Tag(s_building, s_farm, true), new Tag(s_building, s_manufacture, false), new Tag(s_building, s_farm, false),
new Tag(s_surface, s_wood, true), new Tag(s_amenity, s_car_wash, true), new Tag(s_surface, s_wood, false), new Tag(s_amenity, s_car_wash, false),
new Tag(s_amenity, s_dentist, true), new Tag(s_natural, s_marsh, true), new Tag(s_amenity, s_dentist, false), new Tag(s_natural, s_marsh, false),
new Tag(s_man_made, s_surveillance, true), new Tag(s_shop, s_bicycle, true), new Tag(s_man_made, s_surveillance, false), new Tag(s_shop, s_bicycle, false),
new Tag(s_route, s_foot, true), new Tag(s_amenity, s_theatre, true), new Tag(s_route, s_foot, false), new Tag(s_amenity, s_theatre, false),
new Tag(s_building, s_office, true), new Tag(s_railway, s_light_rail, true), new Tag(s_building, s_office, false), new Tag(s_railway, s_light_rail, false),
new Tag(s_man_made, s_petroleum_well, true), new Tag(s_man_made, s_petroleum_well, false),
new Tag(s_amenity, s_taxi, true), new Tag(s_building, s_greenhouse, true), new Tag(s_amenity, s_taxi, false), new Tag(s_building, s_greenhouse, false),
new Tag(s_landuse, s_brownfield, true), new Tag(s_landuse, s_brownfield, false),
new Tag(s_bicycle, s_permissive, true), new Tag(s_admin_level, s_2, true), new Tag(s_bicycle, s_permissive, false), new Tag(s_admin_level, s_2, false),
new Tag(s_aeroway, s_apron, true), new Tag(s_building, s_cabin, true), new Tag(s_aeroway, s_apron, false), new Tag(s_building, s_cabin, false),
new Tag(s_amenity, s_cinema, true), new Tag(s_access, s_customers, true), new Tag(s_amenity, s_cinema, false), new Tag(s_access, s_customers, false),
new Tag(s_tourism, s_motel, true), new Tag(s_railway, s_narrow_gauge, true), new Tag(s_tourism, s_motel, false), new Tag(s_railway, s_narrow_gauge, false),
new Tag(s_amenity, s_marketplace, true), new Tag(s_shop, s_furniture, true), new Tag(s_amenity, s_marketplace, false), new Tag(s_shop, s_furniture, false),
new Tag(s_entrance, s_staircase, true), new Tag(s_tourism, s_artwork, true), new Tag(s_entrance, s_staircase, false), new Tag(s_tourism, s_artwork, false),
new Tag(s_natural, s_grassland, true), new Tag(s_shop, s_books, true), new Tag(s_natural, s_grassland, false), new Tag(s_shop, s_books, false),
new Tag(s_admin_level, s_5, true), new Tag(s_man_made, s_groyne, true), new Tag(s_admin_level, s_5, false), new Tag(s_man_made, s_groyne, false),
new Tag(s_waterway, s_lock_gate, true), new Tag(s_waterway, s_lock_gate, false),
new Tag(s_highway, s_emergency_access_point, true), new Tag(s_highway, s_emergency_access_point, false),
new Tag(s_natural, s_sand, true), new Tag(s_landuse, s_military, true), new Tag(s_natural, s_sand, false), new Tag(s_landuse, s_military, false),
new Tag(s_boundary, s_protected_area, true), new Tag(s_boundary, s_protected_area, false),
new Tag(s_amenity, s_community_centre, true), new Tag(s_amenity, s_community_centre, false),
new Tag(s_barrier, s_kissing_gate, true), new Tag(s_barrier, s_kissing_gate, false),
new Tag(s_highway, s_speed_camera, true), new Tag(s_highway, s_speed_camera, false),
new Tag(s_boundary, s_national_park, true), new Tag(s_boundary, s_national_park, false),
new Tag(s_railway, s_subway_entrance, true), new Tag(s_railway, s_subway_entrance, false),
new Tag(s_man_made, s_silo, true), new Tag(s_shop, s_alcohol, true), new Tag(s_man_made, s_silo, false), new Tag(s_shop, s_alcohol, false),
new Tag(s_highway, s_give_way, true), new Tag(s_leisure, s_slipway, true), new Tag(s_highway, s_give_way, false), new Tag(s_leisure, s_slipway, false),
new Tag(s_shop, s_electronics, true), new Tag(s_bicycle, s_dismount, true), new Tag(s_shop, s_electronics, false), new Tag(s_bicycle, s_dismount, false),
new Tag(s_leisure, s_marina, true), new Tag(s_entrance, s_main, true), new Tag(s_leisure, s_marina, false), new Tag(s_entrance, s_main, false),
new Tag(s_boundary, s_postal_code, true), new Tag(s_boundary, s_postal_code, false),
new Tag(s_landuse, s_greenhouse_horticulture, true), new Tag(s_landuse, s_greenhouse_horticulture, false),
new Tag(s_highway, s_milestone, true), new Tag(s_highway, s_milestone, false),
new Tag(s_natural, s_cave_entrance, true), new Tag(s_natural, s_cave_entrance, false),
new Tag(s_landuse, s_landfill, true), new Tag(s_shop, s_chemist, true), new Tag(s_landuse, s_landfill, false), new Tag(s_shop, s_chemist, false),
new Tag(s_shop, s_shoes, true), new Tag(s_barrier, s_cattle_grid, true), new Tag(s_shop, s_shoes, false), new Tag(s_barrier, s_cattle_grid, false),
new Tag(s_landuse, s_railway, true), new Tag(s_tourism, s_hostel, true), new Tag(s_landuse, s_railway, false), new Tag(s_tourism, s_hostel, false),
new Tag(s_tourism, s_chalet, true), new Tag(s_place, s_county, true), new Tag(s_tourism, s_chalet, false), new Tag(s_place, s_county, false),
new Tag(s_shop, s_department_store, true), new Tag(s_highway, s_ford, true), new Tag(s_shop, s_department_store, false), new Tag(s_highway, s_ford, false),
new Tag(s_natural, s_scree, true), new Tag(s_landuse, s_greenfield, true), new Tag(s_natural, s_scree, false), new Tag(s_landuse, s_greenfield, false),
new Tag(s_amenity, s_nursing_home, true), new Tag(s_amenity, s_nursing_home, false),
new Tag(s_barrier, s_wire_fence, true), new Tag(s_barrier, s_wire_fence, false),
new Tag(s_access, s_restricted, true), new Tag(s_access, s_restricted, false),
new Tag(s_man_made, s_reservoir_covered, true), new Tag(s_man_made, s_reservoir_covered, false),
new Tag(s_amenity, s_bicycle_rental, true), new Tag(s_man_made, s_MDF, true), new Tag(s_amenity, s_bicycle_rental, false), new Tag(s_man_made, s_MDF, false),
new Tag(s_man_made, s_water_well, true), new Tag(s_landuse, s_field, true), new Tag(s_man_made, s_water_well, false), new Tag(s_landuse, s_field, false),
new Tag(s_landuse, s_wood, true), new Tag(s_shop, s_hardware, true), new Tag(s_landuse, s_wood, false), new Tag(s_shop, s_hardware, false),
new Tag(s_tourism, s_alpine_hut, true), new Tag(s_natural, s_tree_row, true), new Tag(s_tourism, s_alpine_hut, false), new Tag(s_natural, s_tree_row, false),
new Tag(s_tourism, s_caravan_site, true), new Tag(s_bridge, s_no, true), new Tag(s_tourism, s_caravan_site, false), new Tag(s_bridge, s_no, false),
new Tag(s_wetland, s_bog, true), new Tag(s_amenity, s_courthouse, true), new Tag(s_wetland, s_bog, false), new Tag(s_amenity, s_courthouse, false),
new Tag(s_route, s_ferry, true), new Tag(s_barrier, s_city_wall, true), new Tag(s_route, s_ferry, false), new Tag(s_barrier, s_city_wall, false),
new Tag(s_amenity, s_veterinary, true), new Tag(s_shop, s_jewelry, true), new Tag(s_amenity, s_veterinary, false), new Tag(s_shop, s_jewelry, false),
new Tag(s_building, s_transportation, true), new Tag(s_building, s_transportation, false),
new Tag(s_amenity, s_arts_centre, true), new Tag(s_amenity, s_arts_centre, false),
new Tag(s_bicycle, s_official, true), new Tag(s_shop, s_optician, true), new Tag(s_bicycle, s_official, false), new Tag(s_shop, s_optician, false),
new Tag(s_shop, s_yes, true), new Tag(s_building, s_collapsed, true), new Tag(s_shop, s_yes, false), new Tag(s_building, s_collapsed, false),
new Tag(s_shop, s_garden_centre, true), new Tag(s_man_made, s_chimney, true), new Tag(s_shop, s_garden_centre, false), new Tag(s_man_made, s_chimney, false),
new Tag(s_man_made, s_mine, true), new Tag(s_bench, s_unknown, true), new Tag(s_man_made, s_mine, false), new Tag(s_bench, s_unknown, false),
new Tag(s_railway, s_preserved, true), new Tag(s_building, s_public, true), new Tag(s_railway, s_preserved, false), new Tag(s_building, s_public, false),
new Tag(s_amenity, s_ferry_terminal, true), new Tag(s_amenity, s_ferry_terminal, false),
new Tag(s_highway, s_raceway, true), new Tag(s_natural, s_rock, true), new Tag(s_highway, s_raceway, false), new Tag(s_natural, s_rock, false),
new Tag(s_tunnel, s_no, true), new Tag(s_building, s_university, true), new Tag(s_tunnel, s_no, false), new Tag(s_building, s_university, false),
new Tag(s_shop, s_beverages, true), new Tag(s_shop, s_beverages, false),
new Tag(s_amenity, s_waste_disposal, true), new Tag(s_amenity, s_waste_disposal, false),
new Tag(s_building, s_warehouse, true), new Tag(s_building, s_warehouse, false),
new Tag(s_leisure, s_water_park, true), new Tag(s_shop, s_gift, true), new Tag(s_leisure, s_water_park, false), new Tag(s_shop, s_gift, false),
new Tag(s_place, s_farm, true), new Tag(s_wetland, s_tidalflat, true), new Tag(s_place, s_farm, false), new Tag(s_wetland, s_tidalflat, false),
new Tag(s_waterway, s_waterfall, true), new Tag(s_man_made, s_dolphin, true), new Tag(s_waterway, s_waterfall, false), new Tag(s_man_made, s_dolphin, false),
new Tag(s_service, s_drive_through, true), new Tag(s_service, s_drive_through, false),
new Tag(s_amenity, s_nightclub, true), new Tag(s_building, s_shed, true), new Tag(s_amenity, s_nightclub, false), new Tag(s_building, s_shed, false),
new Tag(s_shop, s_greengrocer, true), new Tag(s_natural, s_fell, true), new Tag(s_shop, s_greengrocer, false), new Tag(s_natural, s_fell, false),
new Tag(s_wetland, s_wet_meadow, true), new Tag(s_aeroway, s_gate, true), new Tag(s_wetland, s_wet_meadow, false), new Tag(s_aeroway, s_gate, false),
new Tag(s_shop, s_computer, true), new Tag(s_man_made, s_lighthouse, true), new Tag(s_shop, s_computer, false), new Tag(s_man_made, s_lighthouse, false),
new Tag(s_wetland, s_reedbed, true), new Tag(s_man_made, s_breakwater, true), new Tag(s_wetland, s_reedbed, false), new Tag(s_man_made, s_breakwater, false),
new Tag(s_surface, s_Dirt_Sand, true), new Tag(s_barrier, s_ditch, true), new Tag(s_surface, s_Dirt_Sand, false), new Tag(s_barrier, s_ditch, false),
new Tag(s_barrier, s_yes, true), new Tag(s_amenity, s_biergarten, true), new Tag(s_barrier, s_yes, false), new Tag(s_amenity, s_biergarten, false),
new Tag(s_shop, s_mobile_phone, true), new Tag(s_route, s_mtb, true), new Tag(s_shop, s_mobile_phone, false), new Tag(s_route, s_mtb, false),
new Tag(s_amenity, s_grit_bin, true), new Tag(s_amenity, s_bbq, true), new Tag(s_amenity, s_grit_bin, false), new Tag(s_amenity, s_bbq, false),
new Tag(s_shop, s_sports, true), new Tag(s_barrier, s_wood_fence, true), new Tag(s_shop, s_sports, false), new Tag(s_barrier, s_wood_fence, false),
new Tag(s_entrance, s_home, true), new Tag(s_shop, s_laundry, true), new Tag(s_entrance, s_home, false), new Tag(s_shop, s_laundry, false),
new Tag(s_man_made, s_gasometer, true), new Tag(s_man_made, s_gasometer, false),
new Tag(s_barrier, s_embankment, true), new Tag(s_shop, s_toys, true), new Tag(s_barrier, s_embankment, false), new Tag(s_shop, s_toys, false),
new Tag(s_wetland, s_saltmarsh, true), new Tag(s_waterway, s_soakhole, true), new Tag(s_wetland, s_saltmarsh, false), new Tag(s_waterway, s_soakhole, false),
new Tag(s_shop, s_travel_agency, true), new Tag(s_shop, s_travel_agency, false),
new Tag(s_man_made, s_water_works, true), new Tag(s_route, s_railway, true), new Tag(s_man_made, s_water_works, false), new Tag(s_route, s_railway, false),
new Tag(s_amenity, s_prison, true), new Tag(s_highway, s_rest_area, true), new Tag(s_amenity, s_prison, false), new Tag(s_highway, s_rest_area, false),
new Tag(s_shop, s_stationery, true), new Tag(s_admin_level, s_11, true), new Tag(s_shop, s_stationery, false), new Tag(s_admin_level, s_11, false),
new Tag(s_building, s_train_station, true), new Tag(s_building, s_train_station, false),
new Tag(s_building, s_storage_tank, true), new Tag(s_building, s_storage_tank, false),
new Tag(s_man_made, s_windmill, true), new Tag(s_shop, s_beauty, true), new Tag(s_man_made, s_windmill, false), new Tag(s_shop, s_beauty, false),
new Tag(s_building, s_semi, true), new Tag(s_highway, s_services, true), new Tag(s_building, s_semi, false), new Tag(s_highway, s_services, false),
new Tag(s_bicycle, s_private, true), new Tag(s_route, s_ski, true), new Tag(s_bicycle, s_private, false), new Tag(s_route, s_ski, false),
new Tag(s_service, s_emergency_access, true), new Tag(s_service, s_emergency_access, false),
new Tag(s_building, s_factory, true), new Tag(s_building, s_factory, false),
new Tag(s_man_made, s_reinforced_slope, true), new Tag(s_man_made, s_reinforced_slope, false),
new Tag(s_amenity, s_car_sharing, true), new Tag(s_surface, s_earth, true), new Tag(s_amenity, s_car_sharing, false), new Tag(s_surface, s_earth, false),
new Tag(s_shop, s_hifi, true), new Tag(s_amenity, s_car_rental, true), new Tag(s_shop, s_hifi, false), new Tag(s_amenity, s_car_rental, false),
new Tag(s_barrier, s_hedge_bank, true), new Tag(s_barrier, s_hedge_bank, false),
new Tag(s_shop, s_confectionery, true), new Tag(s_aeroway, s_terminal, true), new Tag(s_shop, s_confectionery, false), new Tag(s_aeroway, s_terminal, false),
new Tag(s_highway, s_passing_place, true), new Tag(s_highway, s_passing_place, false),
new Tag(s_building, s_building, true), new Tag(s_man_made, s_dyke, true), new Tag(s_building, s_building, false), new Tag(s_man_made, s_dyke, false),
new Tag(s_building, s_construction, true), new Tag(s_building, s_shop, true), new Tag(s_building, s_construction, false), new Tag(s_building, s_shop, false),
new Tag(s_natural, s_reef, true), new Tag(s_landuse, s_aquaculture, true), new Tag(s_natural, s_reef, false), new Tag(s_landuse, s_aquaculture, false),
new Tag(s_shop, s_dry_cleaning, true), new Tag(s_amenity, s_embassy, true), new Tag(s_shop, s_dry_cleaning, false), new Tag(s_amenity, s_embassy, false),
new Tag(s_shop, s_newsagent, true), new Tag(s_landuse, s_salt_pond, true), new Tag(s_shop, s_newsagent, false), new Tag(s_landuse, s_salt_pond, false),
new Tag(s_railway, s_spur, true), new Tag(s_wheelchair, s_unknown, true), new Tag(s_railway, s_spur, false), new Tag(s_wheelchair, s_unknown, false),
new Tag(s_tourism, s_zoo, true), new Tag(s_man_made, s_waterway, true), new Tag(s_tourism, s_zoo, false), new Tag(s_man_made, s_waterway, false),
new Tag(s_surface, s_fine_gravel, true), new Tag(s_shop, s_motorcycle, true), new Tag(s_surface, s_fine_gravel, false), new Tag(s_shop, s_motorcycle, false),
new Tag(s_building, s_Building, true), new Tag(s_building, s_Building, false),
new Tag(s_railway, s_construction, true), new Tag(s_railway, s_construction, false),
new Tag(s_place, s_neighbourhood, true), new Tag(s_route, s_train, true), new Tag(s_place, s_neighbourhood, false), new Tag(s_route, s_train, false),
new Tag(s_building, s_no, true), new Tag(s_natural, s_mud, true), new Tag(s_building, s_no, false), new Tag(s_natural, s_mud, false),
new Tag(s_place, s_region, true), new Tag(s_place, s_region, false),
new Tag(s_landuse, s_reservoir_watershed, true), new Tag(s_landuse, s_reservoir_watershed, false),
new Tag(s_boundary, s_marker, true), new Tag(s_man_made, s_beacon, true), new Tag(s_boundary, s_marker, false), new Tag(s_man_made, s_beacon, false),
new Tag(s_shop, s_outdoor, true), new Tag(s_access, s_public, true), new Tag(s_shop, s_outdoor, false), new Tag(s_access, s_public, false),
new Tag(s_abutters, s_industrial, true), new Tag(s_building, s_barn, true), new Tag(s_abutters, s_industrial, false), new Tag(s_building, s_barn, false),
new Tag(s_leisure, s_picnic_table, true), new Tag(s_leisure, s_picnic_table, false),
new Tag(s_building, s_hospital, true), new Tag(s_access, s_official, true), new Tag(s_building, s_hospital, false), new Tag(s_access, s_official, false),
new Tag(s_shop, s_variety_store, true), new Tag(s_man_made, s_crane, true), new Tag(s_shop, s_variety_store, false), new Tag(s_man_made, s_crane, false),
new Tag(s_amenity, s_parking_fuel, true), new Tag(s_route, s_tram, true), new Tag(s_amenity, s_parking_fuel, false), new Tag(s_route, s_tram, false),
new Tag(s_tourism, s_theme_park, true), new Tag(s_shop, s_pet, true), new Tag(s_tourism, s_theme_park, false), new Tag(s_shop, s_pet, false),
new Tag(s_building, s_kindergarten, true), new Tag(s_building, s_kindergarten, false),
new Tag(s_man_made, s_storage, true), new Tag(s_man_made, s_mast, true), new Tag(s_man_made, s_storage, false), new Tag(s_man_made, s_mast, false),
new Tag(s_amenity, s_parking_entrance, true), new Tag(s_amenity, s_parking_entrance, false),
new Tag(s_amenity, s_clock, true), new Tag(s_amenity, s_clock, false),
new Tag(s_landuse, s_industrial_retail, true), new Tag(s_landuse, s_industrial_retail, false),
new Tag(s_shop, s_video, true), new Tag(s_access, s_delivery, true), new Tag(s_shop, s_video, false), new Tag(s_access, s_delivery, false),
new Tag(s_amenity, s_driving_school, true), new Tag(s_service, s_yes, true), new Tag(s_amenity, s_driving_school, false), new Tag(s_service, s_yes, false),
new Tag(s_natural, s_bare_rock, true), new Tag(s_building, s_chapel, true), new Tag(s_natural, s_bare_rock, false), new Tag(s_building, s_chapel, false),
new Tag(s_natural, s_volcano, true), new Tag(s_waterway, s_dock, true), new Tag(s_natural, s_volcano, false), new Tag(s_waterway, s_dock, false),
new Tag(s_building, s_dormitory, true), new Tag(s_building, s_dormitory, false),
new Tag(s_amenity, s_boat_storage, true), new Tag(s_man_made, s_tank, true), new Tag(s_amenity, s_boat_storage, false), new Tag(s_man_made, s_tank, false),
new Tag(s_man_made, s_flagpole, true), new Tag(s_man_made, s_flagpole, false),
new Tag(s_surface, s_grass_paver, true), new Tag(s_shop, s_organic, true), new Tag(s_surface, s_grass_paver, false), new Tag(s_shop, s_organic, false),
new Tag(s_natural, s_landform, true), new Tag(s_highway, s_unsurfaced, true), new Tag(s_natural, s_landform, false), new Tag(s_highway, s_unsurfaced, false),
new Tag(s_route, s_power, true), new Tag(s_surface, s_mud, true), new Tag(s_route, s_power, false), new Tag(s_surface, s_mud, false),
new Tag(s_building, s_building_concrete, true), new Tag(s_building, s_building_concrete, false),
new Tag(s_abutters, s_retail, true), new Tag(s_building, s_store, true), new Tag(s_abutters, s_retail, false), new Tag(s_building, s_store, false),
new Tag(s_shop, s_vacant, true), new Tag(s_leisure, s_miniature_golf, true), new Tag(s_shop, s_vacant, false), new Tag(s_leisure, s_miniature_golf, false),
new Tag(s_man_made, s_monitoring_station, true), new Tag(s_man_made, s_monitoring_station, false),
new Tag(s_natural, s_waterfall, true), new Tag(s_aeroway, s_hangar, true), new Tag(s_natural, s_waterfall, false), new Tag(s_aeroway, s_hangar, false),
new Tag(s_shop, s_boutique, true), new Tag(s_route, s_detour, true), new Tag(s_shop, s_boutique, false), new Tag(s_route, s_detour, false),
new Tag(s_building, s_way, true), new Tag(s_railway, s_stop, true), new Tag(s_building, s_way, false), new Tag(s_railway, s_stop, false),
new Tag(s_amenity, s_ice_cream, true), new Tag(s_building, s_storage, true), new Tag(s_amenity, s_ice_cream, false), new Tag(s_building, s_storage, false),
new Tag(s_shop, s_car_parts, true), new Tag(s_natural, s_ridge, true), new Tag(s_shop, s_car_parts, false), new Tag(s_natural, s_ridge, false),
new Tag(s_shop, s_tyres, true), new Tag(s_railway, s_dismantled, true), new Tag(s_shop, s_tyres, false), new Tag(s_railway, s_dismantled, false),
new Tag(s_amenity, s_shop, true), new Tag(s_landuse, s_plant_nursery, true), new Tag(s_amenity, s_shop, false), new Tag(s_landuse, s_plant_nursery, false),
new Tag(s_building, s_residentiel1, true), new Tag(s_building, s_residentiel1, false),
new Tag(s_barrier, s_field_boundary, true), new Tag(s_barrier, s_field_boundary, false),
new Tag(s_barrier, s_border_control, true), new Tag(s_barrier, s_border_control, false),
new Tag(s_surface, s_Paved, true), new Tag(s_barrier, s_sally_port, true), new Tag(s_surface, s_Paved, false), new Tag(s_barrier, s_sally_port, false),
new Tag(s_amenity, s_bureau_de_change, true), new Tag(s_amenity, s_bureau_de_change, false),
new Tag(s_leisure, s_fishing, true), new Tag(s_leisure, s_fishing, false),
new Tag(s_amenity, s_charging_station, true), new Tag(s_amenity, s_charging_station, false),
new Tag(s_building, s_supermarket, true), new Tag(s_highway, s_stile, true), new Tag(s_building, s_supermarket, false), new Tag(s_highway, s_stile, false),
new Tag(s_amenity, s_sauna, true), new Tag(s_place, s_municipality, true), new Tag(s_amenity, s_sauna, false), new Tag(s_place, s_municipality, false),
new Tag(s_building, s_hotel, true), new Tag(s_surface, s_metal, true), new Tag(s_building, s_hotel, false), new Tag(s_surface, s_metal, false),
new Tag(s_highway, s_incline_steep, true), new Tag(s_highway, s_incline_steep, false),
new Tag(s_shop, s_estate_agent, true), new Tag(s_natural, s_grass, true), new Tag(s_shop, s_estate_agent, false), new Tag(s_natural, s_grass, false),
new Tag(s_shop, s_pharmacy, true), new Tag(s_shop, s_pharmacy, false),
new Tag(s_surface, s_concrete_plates, true), new Tag(s_surface, s_concrete_plates, false),
new Tag(s_shop, s_copyshop, true), new Tag(s_shop, s_copyshop, false),
new Tag(s_surface, s_paving_stones_30, true), new Tag(s_surface, s_paving_stones_30, false),
new Tag(s_surface, s_interlock, true), new Tag(s_access, s_hov, true), new Tag(s_surface, s_interlock, false), new Tag(s_access, s_hov, false),
new Tag(s_highway, s_elevator, true), new Tag(s_highway, s_elevator, false),
new Tag(s_boundary, s_local_authority, true), new Tag(s_boundary, s_local_authority, false),
new Tag(s_man_made, s_communications_tower, true), new Tag(s_man_made, s_communications_tower, false),
new Tag(s_shop, s_deli, true), new Tag(s_barrier, s_turnstile, true), new Tag(s_shop, s_deli, false), new Tag(s_barrier, s_turnstile, false),
new Tag(s_building, s_offices, true), new Tag(s_building, s_bunker, true), new Tag(s_building, s_offices, false), new Tag(s_building, s_bunker, false),
new Tag(s_natural, s_stone, true), new Tag(s_natural, s_stone, false),
new Tag(s_railway, s_railway_crossing, true), new Tag(s_railway, s_railway_crossing, false),
new Tag(s_leisure, s_dog_park, true), new Tag(s_leisure, s_dog_park, false),
new Tag(s_building, s_semi_detached, true), new Tag(s_building, s_semi_detached, false),
new Tag(s_man_made, s_watermill, true), new Tag(s_route, s_trolleybus, true), new Tag(s_man_made, s_watermill, false), new Tag(s_route, s_trolleybus, false),
new Tag(s_admin_level, s_3, true), new Tag(s_building, s_block, true), new Tag(s_admin_level, s_3, false), new Tag(s_building, s_block, false),
new Tag(s_barrier, s_guard_rail, true), new Tag(s_bicycle, s_unknown, true), new Tag(s_barrier, s_guard_rail, false), new Tag(s_bicycle, s_unknown, false),
new Tag(s_highway, s_abandoned, true), new Tag(s_surface, s_dirt_sand, true), new Tag(s_highway, s_abandoned, false), new Tag(s_surface, s_dirt_sand, false),
new Tag(s_barrier, s_chain, true), new Tag(s_barrier, s_bump_gate, true), new Tag(s_barrier, s_chain, false), new Tag(s_barrier, s_bump_gate, false),
new Tag(s_building, s_residental, true), new Tag(s_surface, s_cement, true), new Tag(s_building, s_residental, false), new Tag(s_surface, s_cement, false),
new Tag(s_man_made, s_embankment, true), new Tag(s_building, s_ruins, true), new Tag(s_man_made, s_embankment, false), new Tag(s_building, s_ruins, false),
new Tag(s_highway, s_incline, true), new Tag(s_abutters, s_commercial, true), new Tag(s_highway, s_incline, false), new Tag(s_abutters, s_commercial, false),
new Tag(s_barrier, s_hampshire_gate, true), new Tag(s_shop, s_music, true), new Tag(s_barrier, s_hampshire_gate, false), new Tag(s_shop, s_music, false),
new Tag(s_shop, s_funeral_directors, true), new Tag(s_shop, s_funeral_directors, false),
new Tag(s_wetland, s_mangrove, true), new Tag(s_place, s_borough, true), new Tag(s_wetland, s_mangrove, false), new Tag(s_place, s_borough, false),
new Tag(s_building, s_apartment, true), new Tag(s_boundary, s_census, true), new Tag(s_building, s_apartment, false), new Tag(s_boundary, s_census, false),
new Tag(s_barrier, s_kerb, true), new Tag(s_building, s_glasshouse, true), new Tag(s_barrier, s_kerb, false), new Tag(s_building, s_glasshouse, false),
new Tag(s_aeroway, s_holding_position, true), new Tag(s_aeroway, s_holding_position, false),
new Tag(s_shop, s_general, true), new Tag(s_building, s_tank, true), new Tag(s_shop, s_general, false), new Tag(s_building, s_tank, false),
new Tag(s_railway, s_monorail, true), new Tag(s_service, s_parking, true), new Tag(s_railway, s_monorail, false), new Tag(s_service, s_parking, false),
new Tag(s_place, s_state, true), new Tag(s_railway, s_proposed, true), new Tag(s_place, s_state, false), new Tag(s_railway, s_proposed, false),
new Tag(s_shop, s_art, true), new Tag(s_natural, s_hill, true), new Tag(s_shop, s_art, false), new Tag(s_natural, s_hill, false),
new Tag(s_railway, s_turntable, true), new Tag(s_tourism, s_cabin, true), new Tag(s_railway, s_turntable, false), new Tag(s_tourism, s_cabin, false),
new Tag(s_shop, s_photo, true), new Tag(s_boundary, s_lot, true), new Tag(s_shop, s_photo, false), new Tag(s_boundary, s_lot, false),
new Tag(s_shop, s_fishmonger, true), new Tag(s_amenity, s_clinic, true), new Tag(s_shop, s_fishmonger, false), new Tag(s_amenity, s_clinic, false),
new Tag(s_boundary, s_political, true), new Tag(s_man_made, s_well, true), new Tag(s_boundary, s_political, false), new Tag(s_man_made, s_well, false),
new Tag(s_highway, s_byway, true), new Tag(s_leisure, s_horse_riding, true), new Tag(s_highway, s_byway, false), new Tag(s_leisure, s_horse_riding, false),
new Tag(s_service, s_bus, true), new Tag(s_building, s_tower, true), new Tag(s_service, s_bus, false), new Tag(s_building, s_tower, false),
new Tag(s_entrance, s_service, true), new Tag(s_shop, s_fabric, true), new Tag(s_entrance, s_service, false), new Tag(s_shop, s_fabric, false),
new Tag(s_railway, s_miniature, true), new Tag(s_abutters, s_mixed, true), new Tag(s_railway, s_miniature, false), new Tag(s_abutters, s_mixed, false),
new Tag(s_surface, s_stone, true), new Tag(s_access, s_emergency, true), new Tag(s_surface, s_stone, false), new Tag(s_access, s_emergency, false),
new Tag(s_landuse, s_mine, true), new Tag(s_amenity, s_shower, true), new Tag(s_landuse, s_mine, false), new Tag(s_amenity, s_shower, false),
new Tag(s_waterway, s_lock, true) new Tag(s_waterway, s_lock, false)
}; };
} }

View File

@ -468,22 +468,14 @@ public class GLRenderer implements GLSurfaceView.Renderer {
// Log.d(TAG, "visible: " + tileCnt); // Log.d(TAG, "visible: " + tileCnt);
uploadCnt = 0; uploadCnt = 0;
// int updateTextures = 0;
// compile data and upload to VBOsi // compile data and upload to VBOsi
for (int i = 0; i < tileCnt; i++) { for (int i = 0; i < tileCnt; i++) {
MapTile tile = tiles[i]; MapTile tile = tiles[i];
// if (!isVisible(mapPosition, tile))
// continue;
if (!tile.isVisible) if (!tile.isVisible)
continue; continue;
// if (MapView.staticLabeling) {
// if (tile.texture == null && TextRenderer.drawToTexture(tile))
// updateTextures++;
// }
if (tile.newData) { if (tile.newData) {
uploadTileData(tile); uploadTileData(tile);
continue; continue;
@ -527,11 +519,6 @@ public class GLRenderer implements GLSurfaceView.Renderer {
} }
// } // }
// if (MapView.staticLabeling) {
// if (updateTextures > 0)
// TextRenderer.compileTextures();
// }
GLES20.glEnable(GL_DEPTH_TEST); GLES20.glEnable(GL_DEPTH_TEST);
GLES20.glEnable(GL_POLYGON_OFFSET_FILL); GLES20.glEnable(GL_POLYGON_OFFSET_FILL);
@ -560,40 +547,6 @@ public class GLRenderer implements GLSurfaceView.Renderer {
GLES20.glEnable(GL_BLEND); GLES20.glEnable(GL_BLEND);
// if (MapView.staticLabeling) {
// int z = mapPosition.zoomLevel;
// float s = mapPosition.scale;
// int zoomLevelDiff = Math.max(z - TileGenerator.STROKE_MAX_ZOOM_LEVEL,
// 0);
// float scale = (float) Math.pow(1.4, zoomLevelDiff);
// if (scale < 1)
// scale = 1;
//
// if (z >= TileGenerator.STROKE_MAX_ZOOM_LEVEL)
// TextRenderer.beginDraw(scale / FloatMath.sqrt(s), mProjMatrix);
// else
// TextRenderer.beginDraw(1f / s, mProjMatrix);
//
// for (int i = 0; i < tileCnt; i++) {
// MapTile t = tiles[i];
// if (!t.isVisible)
// continue;
//
// if (t.holder == null) {
// if (t.texture != null) {
// setMatrix(mMVPMatrix, t, 1, false);
// TextRenderer.drawTile(t, mMVPMatrix);
// }
// } else {
// if (t.holder.texture != null) {
// setMatrix(mMVPMatrix, t, 1, false);
// TextRenderer.drawTile(t.holder, mMVPMatrix);
// }
// }
// }
// TextRenderer.endDraw();
// }
// call overlay renderer // call overlay renderer
for (Overlay overlay : mOverlays) { for (Overlay overlay : mOverlays) {
if (overlay.newData) { if (overlay.newData) {

View File

@ -32,24 +32,10 @@ public final class Shaders {
+ " gl_Position = u_mvp * vec4(a_position + dir, 0.0,1.0);" + " gl_Position = u_mvp * vec4(a_position + dir, 0.0,1.0);"
// last two bits of a_st hold the texture coordinates // last two bits of a_st hold the texture coordinates
+ " v_st = u_width * (abs(mod(a_st,4.0)) - 1.0);" + " v_st = u_width * (abs(mod(a_st,4.0)) - 1.0);"
// TODO use bit operations when available (gles 1.3) // use bit operations when available (gles 1.3)
// + " v_st = u_width * vec2(ivec2(a_st) & 3 - 1);" // + " v_st = u_width * vec2(ivec2(a_st) & 3 - 1);"
+ "}"; + "}";
// final static String lineVertexShader = ""
// + "precision mediump float;"
// + "uniform mat4 mvp;"
// + "attribute vec4 a_position;"
// + "attribute vec2 a_st;"
// + "varying vec2 v_st;"
// + "uniform float u_width;"
// + "const float dscale = 8.0/1000.0;"
// + "void main() {"
// + " vec2 dir = dscale * u_width * a_position.zw;"
// + " gl_Position = mvp * vec4(a_position.xy + dir, 0.0,1.0);"
// + " v_st = u_width * a_st;"
// + "}";
final static String lineSimpleFragmentShader = "" final static String lineSimpleFragmentShader = ""
+ "precision mediump float;" + "precision mediump float;"
+ "uniform float u_wscale;" + "uniform float u_wscale;"
@ -57,7 +43,6 @@ public final class Shaders {
+ "uniform int u_mode;" + "uniform int u_mode;"
+ "uniform vec4 u_color;" + "uniform vec4 u_color;"
+ "varying vec2 v_st;" + "varying vec2 v_st;"
+ "const float zero = 0.0;"
+ "void main() {" + "void main() {"
+ " float len;" + " float len;"
+ " if (u_mode == 0)" + " if (u_mode == 0)"
@ -66,108 +51,31 @@ public final class Shaders {
+ " len = u_width - length(v_st);" + " len = u_width - length(v_st);"
// fade to alpha. u_wscale is the width in pixel which should be // fade to alpha. u_wscale is the width in pixel which should be
// faded, u_width - len the position of this fragment on the // faded, u_width - len the position of this fragment on the
// perpendicular to this line segment // perpendicular to this line segment, only works with no
+ " vec4 color = u_color;" // perspective
+ " if (len < u_wscale)" + " gl_FragColor = u_color * min(1.0, len / u_wscale);"
+ " color *= len / u_wscale;"
+ " gl_FragColor = color;"
// smoothstep(zero, u_wscale, u_width - len) * u_color;"
+ "}"; + "}";
// final static String lineFragmentShader = ""
// + "#extension GL_OES_standard_derivatives : enable\n"
// + "precision mediump float;\n"
// + "uniform float u_wscale;"
// + "uniform float u_width;"
// + "uniform vec4 u_color;"
// + "varying vec2 v_st;"
// + "const float zero = 0.0;"
// + "const vec4 col1 = vec4(0.5,0.0,0.0,0.5);"
// + "const vec4 col2 = vec4(0.0,0.0,0.5,0.5);"
// + "void main() {"
// + " vec4 color = u_color;"
// + " float width = u_width;"
// + " float len;"
// + " if (v_st.t == zero)"
// + " len = abs(v_st.s);"
// + " else "
// + " len = length(v_st);"
// + " vec2 st_width = fwidth(v_st);"
// + " float fuzz = max(st_width.s, st_width.t);"
// // + " if (v_st.s > 0.0){"
// // + " color = col1;"
// + " color *= (1.0 - len) / (fuzz + u_wscale);"
// // + " }else{"
// // + " color = col2;"
// // + " color *= 1.0 - (fuzz + u_wscale) / (len - 1.0);"
// // + " }"
// + " gl_FragColor = color;"
// + "}";
// final static String lineFragmentShader = ""
// + "#extension GL_OES_standard_derivatives : enable\n"
// + "precision mediump float;\n"
// + "uniform float u_wscale;"
// + "uniform float u_width;"
// + "uniform vec4 u_color;"
// + "varying vec2 v_st;"
// + "const float zero = 0.0;"
// + "const vec4 col1 = vec4(0.5,0.0,0.0,0.5);"
// + "const vec4 col2 = vec4(0.0,0.0,0.5,0.5);"
// + "void main() {"
// + " vec4 color = u_color;"
// + " float width = u_width;"
// + " float len;"
// + " if (v_st.t == zero)"
// + " len = abs(v_st.s);"
// + " else "
// + " len = length(v_st);"
// + " vec2 st_width = fwidth(v_st);"
// + " float fuzz = max(st_width.s, st_width.t);"
// + " if (u_width > 1.0) fuzz *= 1.2;"
// + " color *= (u_width - len) / (fuzz + u_wscale);"
// + " if (v_st.s > 0.0){"
// + " if (u_width - len < fuzz + u_wscale)"
// + " color = col1 * (u_width - len) / (fuzz + u_wscale);"
// + " }else{"
// + " if (u_width - len < fuzz + u_wscale)"
// + " color = col2 * (u_width - len) / (fuzz + u_wscale);"
// + "}"
// // + " color *= (fuzz + u_wscale);"
// // " color *= smoothstep(zero, fuzz + u_wscale, u_width - len);"
// + " gl_FragColor = color;"
// + "}";
final static String lineFragmentShader = "" final static String lineFragmentShader = ""
+ "#extension GL_OES_standard_derivatives : enable\n" + "#extension GL_OES_standard_derivatives : enable\n"
+ "precision mediump float;\n" + "precision mediump float;"
+ "uniform float u_wscale;" + "uniform float u_wscale;"
+ "uniform float u_width;" + "uniform float u_width;"
+ "uniform int u_mode;" + "uniform int u_mode;"
+ "uniform vec4 u_color;" + "uniform vec4 u_color;"
+ "varying vec2 v_st;" + "varying vec2 v_st;"
// + "const vec4 col1 = vec4(0.5,0.0,0.0,0.5);"
// + "const vec4 col2 = vec4(0.0,0.0,0.5,0.5);"
+ "const float zero = 0.0;"
+ "void main() {" + "void main() {"
+ " vec4 color = u_color;"
+ " float width = u_width;"
+ " float len;" + " float len;"
+ " if (u_mode == 0)" + " float fuzz;"
+ " if (u_mode == 0){"
+ " len = u_width - abs(v_st.s);" + " len = u_width - abs(v_st.s);"
+ " else " + " fuzz = u_wscale + fwidth(v_st.s);"
+ " } else {"
+ " len = u_width - length(v_st);" + " len = u_width - length(v_st);"
+ " vec2 st_width = fwidth(v_st);" + " vec2 st_width = fwidth(v_st);"
+ " float fuzz = max(st_width.s, st_width.t);" + " fuzz = u_wscale + max(st_width.s, st_width.t);"
// + " if (u_width > 1.0) fuzz *= 1.2;"
+ " fuzz += u_wscale;"
+ " if (len < fuzz){"
// + " if (v_st.s > zero)"
+ " color *= len / fuzz;"
// + " else"
// + " color = col2 * (u_width - len) / fuzz;"
+ " }" + " }"
+ " gl_FragColor = color;" + " gl_FragColor = u_color * min(1.0, len / fuzz);"
+ "}"; + "}";
final static String polygonVertexShader = "" final static String polygonVertexShader = ""
@ -209,48 +117,6 @@ public final class Shaders {
+ " tex_c = tex_coord * div;" + " tex_c = tex_coord * div;"
+ "}"; + "}";
// final static String textVertexShader = ""
// + "precision highp float; "
// + "attribute vec4 vertex;"
// + "attribute vec2 tex_coord;"
// + "uniform mat4 mvp;"
// + "uniform mat4 viewMatrix;"
// + "uniform float scale;"
// + "varying vec2 tex_c;"
// + "const vec2 div = vec2(1.0/4096.0,1.0/2048.0);"
// + "void main() {"
// + " vec4 pos;"
// + " if (mod(vertex.x, 2.0) == 0.0){"
// + " pos = mvp * vec4(vertex.xy + vertex.zw / scale, 0.0, 1.0);"
// + " } else {"
// + " vec4 dir = viewMatrix * vec4(vertex.zw / scale, 0.0, 1.0);"
// + " pos = mvp * vec4(vertex.xy + dir.xy, 0.0, 1.0);"
// + " }"
// + " pos.z = 0.0;"
// + " gl_Position = pos;"
// + " tex_c = tex_coord * div;"
// + "}";
// final static String textVertexShader = ""
// + "precision highp float; "
// + "attribute vec4 vertex;"
// + "attribute vec2 tex_coord;"
// + "uniform mat4 mvp;"
// + "uniform mat4 viewMatrix;"
// + "uniform float scale;"
// + "varying vec2 tex_c;"
// + "const vec2 div = vec2(1.0/4096.0,1.0/2048.0);"
// + "void main() {"
// + " if (mod(vertex.x, 2.0) == 0.0){"
// +
// " gl_Position = mvp * vec4(vertex.xy + vertex.zw / scale, 0.0, 1.0);"
// + " } else {"
// + " vec4 dir = viewMatrix * vec4(vertex.zw / scale, 0.0, 1.0);"
// + " gl_Position = mvp * vec4(vertex.xy + dir.xy, 0.0, 1.0);"
// + " }"
// + " tex_c = tex_coord * div;"
// + "}";
final static String textFragmentShader = "" final static String textFragmentShader = ""
+ "precision highp float;" + "precision highp float;"
+ "uniform sampler2D tex;" + "uniform sampler2D tex;"
@ -280,24 +146,28 @@ public final class Shaders {
// + " v_st = u_mode[1] * vec2(-a_st2.s , a_st2.t);" // + " v_st = u_mode[1] * vec2(-a_st2.s , a_st2.t);"
// + "}"; // + "}";
// final static String lineVertexShader = ""
// + "precision mediump float;"
// + "uniform mat4 mvp;"
// + "attribute vec4 a_position;"
// + "attribute vec2 a_st;"
// + "varying vec2 v_st;"
// + "uniform float u_width;"
// + "const float dscale = 8.0/1000.0;"
// + "void main() {"
// + " vec2 dir = dscale * u_width * a_position.zw;"
// + " gl_Position = mvp * vec4(a_position.xy + dir, 0.0,1.0);"
// + " v_st = u_width * a_st;"
// + "}";
// final static String lineFragmentShader = "" // final static String lineFragmentShader = ""
// + "#extension GL_OES_standard_derivatives : enable\n" // + "#extension GL_OES_standard_derivatives : enable\n"
// + "precision mediump float;" // + "precision mediump float;"
// + "uniform vec2 u_mode;" // + "uniform float u_wscale;"
// + "uniform float u_width;"
// + "uniform int u_mode;"
// + "uniform vec4 u_color;" // + "uniform vec4 u_color;"
// + "varying vec2 v_st;" // + "varying vec2 v_st;"
// + "const float zero = 0.0;"
// + "void main() {" // + "void main() {"
// + " vec4 color = u_color;" // + " gl_FragColor = u_color * 0.5;"
// + " float width = u_mode[1];"
// + " float len;"
// + " if (v_st.t == zero)"
// + " len = abs(v_st.s);"
// + " else "
// + " len = length(v_st);"
// + " vec2 st_width = fwidth(v_st);"
// + " float fuzz = max(st_width.s, st_width.t);"
// + " color.a *= smoothstep(-pixel, fuzz*pixel, width - (len * width));"
// + " gl_FragColor = color;"
// + "}"; // + "}";
} }

View File

@ -1,458 +0,0 @@
/*
* Copyright 2012 Hannes Janetzek
*
* This program is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.oscim.renderer;
//import java.nio.ByteBuffer;
//import java.nio.ByteOrder;
//import java.nio.ShortBuffer;
//
//import org.oscim.renderer.layer.TextItem;
//import org.oscim.utils.GlUtils;
//
//import android.graphics.Bitmap;
//import android.graphics.Canvas;
//import android.graphics.Color;
//import android.graphics.Paint;
//import android.opengl.GLES20;
//import android.opengl.GLUtils;
//import android.util.FloatMath;
//import android.util.Log;
//
//public class TextRenderer {
// private static String TAG = "TextRenderer";
//
// private final static int TEXTURE_WIDTH = 256;
// private final static int TEXTURE_HEIGHT = 256;
// private final static float SCALE = 8.0f;
// private final static int LBIT_MASK = 0xfffffffe;
// // private final static int L2BIT_MASK = 0xfffffffc;
//
// final static int INDICES_PER_SPRITE = 6;
// final static int VERTICES_PER_SPRITE = 4;
// final static int SHORTS_PER_VERTICE = 6;
// final static int MAX_LABELS = 35;
//
// private static Bitmap mBitmap;
// private static Canvas mCanvas;
// private static int mFontPadX = 1;
// private static int mFontPadY = 1;
// private static int mBitmapFormat;
// private static int mBitmapType;
// private static ShortBuffer mShortBuffer;
// private static TextTexture[] mTextures;
//
// private static int mIndicesVBO;
// private static int mVerticesVBO;
//
// private static int mTextProgram;
// private static int hTextMVMatrix;
// private static int hTextProjectionMatrix;
// private static int hTextVertex;
// private static int hTextScale;
// private static int hTextScreenScale;
// private static int hTextTextureCoord;
//
// private static Paint mPaint = new Paint(Color.BLACK);
//
// private static boolean debug = false;
// private static short[] debugVertices = {
//
// 0, 0,
// 0, TEXTURE_HEIGHT * 4,
//
// 0, TEXTURE_HEIGHT - 1,
// 0, 0,
//
// TEXTURE_WIDTH - 1, 0,
// TEXTURE_WIDTH * 4, TEXTURE_HEIGHT * 4,
//
// TEXTURE_WIDTH - 1, TEXTURE_HEIGHT - 1,
// TEXTURE_WIDTH * 4, 0,
//
// };
//
// static void init() {
// mTextProgram = GlUtils.createProgram(Shaders.textVertexShader,
// Shaders.textFragmentShader);
//
// hTextMVMatrix = GLES20.glGetUniformLocation(mTextProgram, "u_mv");
// hTextProjectionMatrix = GLES20.glGetUniformLocation(mTextProgram, "u_proj");
// hTextScale = GLES20.glGetUniformLocation(mTextProgram, "u_scale");
// hTextScreenScale = GLES20.glGetUniformLocation(mTextProgram, "u_swidth");
// hTextVertex = GLES20.glGetAttribLocation(mTextProgram, "vertex");
// hTextTextureCoord = GLES20.glGetAttribLocation(mTextProgram, "tex_coord");
//
// }
//
// static boolean setup(int numTextures) {
// int bufferSize = numTextures
// * MAX_LABELS * VERTICES_PER_SPRITE
// * SHORTS_PER_VERTICE * (Short.SIZE / 8);
//
// // if (mBitmap == null) {
// mBitmap = Bitmap.createBitmap(TEXTURE_WIDTH, TEXTURE_HEIGHT,
// Bitmap.Config.ARGB_8888);
// mCanvas = new Canvas(mBitmap);
//
// mBitmapFormat = GLUtils.getInternalFormat(mBitmap);
// mBitmapType = GLUtils.getType(mBitmap);
//
// ByteBuffer buf = ByteBuffer.allocateDirect(bufferSize)
// .order(ByteOrder.nativeOrder());
//
// mShortBuffer = buf.asShortBuffer();
// // }
//
// int[] textureIds = new int[numTextures];
// TextTexture[] textures = new TextTexture[numTextures];
// GLES20.glGenTextures(numTextures, textureIds, 0);
//
// for (int i = 0; i < numTextures; i++) {
// // setup filters for texture
// GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, textureIds[i]);
//
// GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER,
// GLES20.GL_LINEAR);
// GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER,
// GLES20.GL_LINEAR);
// GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S,
// GLES20.GL_CLAMP_TO_EDGE); // Set U Wrapping
// GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_T,
// GLES20.GL_CLAMP_TO_EDGE); // Set V Wrapping
//
// // load the generated bitmap onto the texture
// GLUtils.texImage2D(GLES20.GL_TEXTURE_2D, 0, mBitmapFormat, mBitmap,
// mBitmapType, 0);
//
// textures[i] = new TextTexture(textureIds[i]);
// }
//
// GlUtils.checkGlError("init textures");
//
// mTextures = textures;
//
// // Setup triangle indices
// short[] indices = new short[MAX_LABELS * INDICES_PER_SPRITE];
// int len = indices.length;
// short j = 0;
// for (int i = 0; i < len; i += INDICES_PER_SPRITE, j += VERTICES_PER_SPRITE) {
// indices[i + 0] = (short) (j + 0);
// indices[i + 1] = (short) (j + 1);
// indices[i + 2] = (short) (j + 2);
// indices[i + 3] = (short) (j + 2);
// indices[i + 4] = (short) (j + 3);
// indices[i + 5] = (short) (j + 0);
// }
//
// mShortBuffer.clear();
// mShortBuffer.put(indices, 0, len);
// mShortBuffer.flip();
//
// int[] mVboIds = new int[2];
// GLES20.glGenBuffers(2, mVboIds, 0);
// mIndicesVBO = mVboIds[0];
// mVerticesVBO = mVboIds[1];
//
// GLES20.glBindBuffer(GLES20.GL_ELEMENT_ARRAY_BUFFER, mIndicesVBO);
// GLES20.glBufferData(GLES20.GL_ELEMENT_ARRAY_BUFFER, len * (Short.SIZE / 8),
// mShortBuffer, GLES20.GL_STATIC_DRAW);
// GLES20.glBindBuffer(GLES20.GL_ELEMENT_ARRAY_BUFFER, 0);
//
// mShortBuffer.clear();
// GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, mVerticesVBO);
// GLES20.glBufferData(GLES20.GL_ARRAY_BUFFER, bufferSize,
// mShortBuffer, GLES20.GL_DYNAMIC_DRAW);
// GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, 0);
//
// return true;
// }
//
// static boolean drawToTexture(MapTile tile) {
// TextTexture tex = null;
//
// if (tile.labels == null)
// return false;
//
// for (int i = 0; i < mTextures.length; i++) {
// tex = mTextures[i];
// if (tex.tile == null)
// break;
//
// if (!tex.tile.isLocked())
// break;
//
// tex = null;
// }
//
// if (tex == null) {
// for (int i = 0; i < mTextures.length; i++) {
// tex = mTextures[i];
// if (!tex.tile.isVisible)
// break;
//
// tex = null;
// }
// }
//
// if (tex == null) {
// Log.d(TAG, "no textures left");
// return false;
// }
// if (tex.tile != null)
// tex.tile.texture = null;
//
// mBitmap.eraseColor(Color.TRANSPARENT);
//
// int pos = 0;
// short[] buf = tex.vertices;
//
// float y = 0;
// float x = mFontPadX;
// float width, height;
//
// int max = MAX_LABELS;
//
// if (debug) {
// mCanvas.drawLine(debugVertices[0], debugVertices[1], debugVertices[4],
// debugVertices[5], mPaint);
// mCanvas.drawLine(debugVertices[0], debugVertices[1], debugVertices[8],
// debugVertices[9], mPaint);
//
// mCanvas.drawLine(debugVertices[12], debugVertices[13], debugVertices[4],
// debugVertices[5], mPaint);
// mCanvas.drawLine(debugVertices[12], debugVertices[13], debugVertices[8],
// debugVertices[9], mPaint);
// }
//
// int advanceY = 0;
//
// TextItem t = tile.labels;
// float yy;
//
// for (int i = 0; t != null && i < max; t = t.next, i++) {
// if (t.text.caption)
// continue;
//
// height = (int) (t.text.fontHeight) + 2 * mFontPadY;
// width = t.width + 2 * mFontPadX;
//
// if (height > advanceY)
// advanceY = (int) height;
//
// if (x + width > TEXTURE_WIDTH) {
// x = mFontPadX;
// y += advanceY;
// advanceY = (int) height;
// }
//
// yy = y + (height - 1) - t.text.fontDescent - mFontPadY;
// if (yy > TEXTURE_HEIGHT) {
// Log.d(TAG, "reached max labels");
// break;
// // continue;
// }
//
// if (t.text.stroke != null)
// mCanvas.drawText(t.string, x + t.width / 2, yy, t.text.stroke);
//
// mCanvas.drawText(t.string, x + t.width / 2, yy, t.text.paint);
//
// if (width > TEXTURE_WIDTH)
// width = TEXTURE_WIDTH;
//
// float hw = width / 2.0f;
// float hh = height / 2.0f;
// short x1, x2, x3, x4, y1, y2, y3, y4;
//
// if (t.text.caption) {
// x1 = x3 = (short) (SCALE * (-hw));
// y1 = y3 = (short) (SCALE * (hh));
// x2 = x4 = (short) (SCALE * (hw));
// y2 = y4 = (short) (SCALE * (-hh));
// } else {
// float vx = t.x1 - t.x2;
// float vy = t.y1 - t.y2;
// float a = FloatMath.sqrt(vx * vx + vy * vy);
// vx = vx / a;
// vy = vy / a;
//
// float ux = -vy;
// float uy = vx;
//
// // int dx = (int) (vx * SCALE) & L2BIT_MASK;
// // int dy = (int) (vy * SCALE) & L2BIT_MASK;
// //
// // x1 = (short) dx;
// // y1 = (short) dy;
// //
// // x2 = (short) (dx | 1);
// // y3 = (short) (dy | 1);
// //
// // x4 = (short) (dx | 3);
// // y4 = (short) (dy | 3);
// //
// // x3 = (short) (dx | 2);
// // y2 = (short) (dy | 2);
//
// x1 = (short) (SCALE * (vx * hw - ux * hh));
// y1 = (short) (SCALE * (vy * hw - uy * hh));
// x2 = (short) (SCALE * (-vx * hw - ux * hh));
// y3 = (short) (SCALE * (-vy * hw - uy * hh));
// x4 = (short) (SCALE * (-vx * hw + ux * hh));
// y4 = (short) (SCALE * (-vy * hw + uy * hh));
// x3 = (short) (SCALE * (vx * hw + ux * hh));
// y2 = (short) (SCALE * (vy * hw + uy * hh));
//
// }
// short u1 = (short) (SCALE * x);
// short v1 = (short) (SCALE * y);
// short u2 = (short) (SCALE * (x + width));
// short v2 = (short) (SCALE * (y + height));
//
// // pack caption/way-text info in lowest bit
// int tmp = (int) (SCALE * t.x) & LBIT_MASK;
// short tx = (short) (tmp | (t.text.caption ? 1 : 0));
//
// short ty = (short) (SCALE * t.y);
//
// // top-left
// buf[pos++] = tx;
// buf[pos++] = ty;
// buf[pos++] = x1;
// buf[pos++] = y1;
// buf[pos++] = u1;
// buf[pos++] = v2;
//
// // top-right
// buf[pos++] = tx;
// buf[pos++] = ty;
// buf[pos++] = x2;
// buf[pos++] = y3;
// buf[pos++] = u2;
// buf[pos++] = v2;
//
// // bot-right
// buf[pos++] = tx;
// buf[pos++] = ty;
// buf[pos++] = x4;
// buf[pos++] = y4;
// buf[pos++] = u2;
// buf[pos++] = v1;
//
// // bot-left
// buf[pos++] = tx;
// buf[pos++] = ty;
// buf[pos++] = x3;
// buf[pos++] = y2;
// buf[pos++] = u1;
// buf[pos++] = v1;
//
// x += width;
//
// if (y > TEXTURE_HEIGHT) {
// Log.d(TAG, "reached max labels: texture is full");
// break;
// }
// }
//
// tex.length = pos;
// tile.texture = tex;
// tex.tile = tile;
//
// GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, tex.id);
// GLUtils.texSubImage2D(GLES20.GL_TEXTURE_2D, 0, 0, 0, mBitmap,
// mBitmapFormat, mBitmapType);
//
// // FIXME shouldnt be needed here, still looking for sometimes corrupted
// // labels..
// GLES20.glFlush();
//
// return true;
// }
//
// static void compileTextures() {
// int offset = 0;
// TextTexture tex;
//
// GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, mVerticesVBO);
//
// mShortBuffer.clear();
//
// for (int i = 0; i < mTextures.length; i++) {
// tex = mTextures[i];
// if (tex.tile == null) // || !tex.tile.isLocked)
// continue;
//
// mShortBuffer.put(tex.vertices, 0, tex.length);
// tex.offset = offset;
// offset += tex.length;
// }
//
// mShortBuffer.flip();
//
// GLES20.glBufferSubData(GLES20.GL_ARRAY_BUFFER, 0, offset * (Short.SIZE / 8),
// mShortBuffer);
// }
//
// static void beginDraw(float scale, float[] projection) {
// GLES20.glUseProgram(mTextProgram);
//
// // GLES20.glEnableVertexAttribArray(hTextTextureCoord);
// // GLES20.glEnableVertexAttribArray(hTextVertex);
//
// int va = hTextTextureCoord;
// if (!GLRenderer.vertexArray[va]) {
// GLES20.glEnableVertexAttribArray(va);
// GLRenderer.vertexArray[va] = true;
// }
//
// va = hTextVertex;
// if (!GLRenderer.vertexArray[va]) {
// GLES20.glEnableVertexAttribArray(va);
// GLRenderer.vertexArray[va] = true;
// }
//
// GLES20.glUniform1f(hTextScale, scale);
// GLES20.glUniform1f(hTextScreenScale, 1f / GLRenderer.mWidth);
// GLES20.glUniformMatrix4fv(hTextProjectionMatrix, 1, false, projection, 0);
//
// GLES20.glBindBuffer(GLES20.GL_ELEMENT_ARRAY_BUFFER, mIndicesVBO);
// GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, mVerticesVBO);
// }
//
// static void endDraw() {
// GLES20.glBindBuffer(GLES20.GL_ELEMENT_ARRAY_BUFFER, 0);
//
// // GLES20.glDisableVertexAttribArray(hTextTextureCoord);
// // GLES20.glDisableVertexAttribArray(hTextVertex);
// }
//
// static void drawTile(MapTile tile, float[] matrix) {
//
// GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, tile.texture.id);
//
// GLES20.glUniformMatrix4fv(hTextMVMatrix, 1, false, matrix, 0);
//
// GLES20.glVertexAttribPointer(hTextVertex, 4,
// GLES20.GL_SHORT, false, 12, tile.texture.offset * (Short.SIZE / 8));
//
// GLES20.glVertexAttribPointer(hTextTextureCoord, 2,
// GLES20.GL_SHORT, false, 12, tile.texture.offset * (Short.SIZE / 8)
// + 8);
//
// GLES20.glDrawElements(GLES20.GL_TRIANGLES, (tile.texture.length / 24) *
// INDICES_PER_SPRITE, GLES20.GL_UNSIGNED_SHORT, 0);
// }
// }

View File

@ -1,33 +0,0 @@
/*
* Copyright 2012 Hannes Janetzek
*
* This program is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.oscim.renderer;
//public class TextTexture {
//
// final short[] vertices;
// final int id;
// int length;
// int offset;
// MapTile tile;
//
// TextTexture(int textureID) {
// vertices = new short[TextRenderer.MAX_LABELS *
// TextRenderer.VERTICES_PER_SPRITE *
// TextRenderer.SHORTS_PER_VERTICE];
//
// id = textureID;
// }
//
// }

View File

@ -72,7 +72,8 @@
<style-line name="aeroway:runway" stroke="#c8ccbe" width="1.8" cap="butt" /> <style-line name="aeroway:runway" stroke="#c8ccbe" width="1.8" cap="butt" />
<style-line name="building" stroke="#c9c3c1" width="1.0" fixed="true" cap="butt" fade="15"/> <!-- <style-line name="building" stroke="#c9c3c1" width="1.0" fixed="true" cap="butt" fade="15"/> -->
<style-line name="building" stroke="#d0cec8" width="1.0" fixed="true" cap="butt" fade="15"/>
<style-area name="building" fill="#e9e6e3" fade="15"/> <style-area name="building" fill="#e9e6e3" fade="15"/>
<!-- ways --> <!-- ways -->