This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mapnik = require('mapnik'); | |
var proj4 = '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over'; | |
var mercator = new mapnik.Projection(proj4); | |
/** | |
* SphericalMercator constructor: precaches calculations | |
* for fast tile lookups | |
*/ | |
function SphericalMercator() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Wu.DomEvent.on(box, 'keydown', this._throttledSave, this); | |
_throttledSave : function () { | |
_.throttle(this.save, 1000); | |
}, | |
save : function () { | |
var text = div.innerHTML; | |
this._project.setText(text); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT ST_Transform(ST_Intersection(lg.geometry, bbox.geom), 4326) As geometry, | |
SELECT "name","type","area","z_order" As properties FROM osm_landusages As lg, ( | |
SELECT ST_Transform(ST_MakeEnvelope(-2.8125,38.82259097617711,25.312499999999986,57.326521225217064, 4326),3857) as geom) as bbox | |
WHERE ST_Intersects(lg.geometry, bbox.geom) | |
AND (area > 200000000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT row_to_json(fc) FROM ( | |
SELECT ST_AsGeoJSON(ST_Transform(ST_Intersection(lg.geometry, bbox.geom), 4326))::json As geometry, ( | |
SELECT row_to_json(t) FROM ( | |
SELECT "name","type","area","z_order") t ) As properties FROM osm_landusages As lg, ( | |
SELECT ST_Transform(ST_MakeEnvelope(-2.8125,38.82259097617711,25.312499999999986,57.326521225217064, 4326),3857) as geom) as bbox | |
WHERE ST_Intersects(lg.geometry, bbox.geom) | |
AND (area > 200000000) ) fc; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EXPLAIN ANALYZE VERBOSE SELECT ST_AsGeoJSON(ST_Intersection(lg.geometry, bbox.geom)) As geometry, ( SELECT rowea","z_order") t ) As properties FROM osm_landusages As lg, (SELECT ST_Transform(ST_MakeEnvelope(-2.8125,38.822590974, 4326),3857) as geom) as bbox WHERE ST_Intersects(lg.geometry, bbox.geom) AND (area > 200000000) ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT row_to_json(fc) FROM ( | |
SELECT ST_AsGeoJSON(ST_Transform(ST_Intersection(lg.geometry, bbox.geom), 4326))::json As geometry, ( | |
SELECT row_to_json(t) FROM ( | |
SELECT "name","type","area","z_order") t ) As properties FROM osm_landusages As lg, ( | |
SELECT ST_Transform(ST_MakeEnvelope(-2.8125,38.82259097617711,25.312499999999986,57.326521225217064, 4326),3857) | |
as geom) as bbox | |
WHERE ST_Intersects(lg.geometry, bbox.geom) | |
AND (area > 200000000) ) fc; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List of relations | |
Schema | Name | Type | Owner | |
--------+-------------------------------+-------+---------- | |
public | ne_bathymetry | table | osm | |
public | ne_urban_areas | table | osm | |
public | osm_admin | table | osm | |
public | osm_aeroways | table | osm | |
public | osm_amenities | table | osm | |
public | osm_barrierpoints | table | osm | |
public | osm_barrierways | table | osm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Indexes: | |
"ne_bathymetry_pkey" PRIMARY KEY, btree (gid) | |
"ne_bathymetry_geom_idx" gist (geometry) | |
"ne_bathymetry_geom_idx1" gist (geometry) | |
"ne_bathymetry_geom_idx10" gist (geometry) | |
"ne_bathymetry_geom_idx2" gist (geometry) | |
"ne_bathymetry_geom_idx3" gist (geometry) | |
"ne_bathymetry_geom_idx4" gist (geometry) | |
"ne_bathymetry_geom_idx5" gist (geometry) | |
"ne_bathymetry_geom_idx6" gist (geometry) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT row_to_json(fc) FROM ( SELECT ST_AsGeoJSON(ST_Transform(ST_Intersection(ST_MakeValid(lg.geometry), bbox.geom), 4326))::json As geometry, ( SELECT row_to_json(t) FROM ( SELECT "name","type","area") t ) As properties FROM osm_waterareas As lg, (SELECT ST_Transform(ST_MakeEnvelope(-7.031250000000009,36.59788913307019,-5.625000000000013,37.718590325588146, 4326),3857) as geom) as bbox WHERE ST_Intersects(ST_MakeValid(lg.geometry), bbox.geom) AND (area > 12500000) ) fc; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT row_to_json(fc) | |
FROM ( | |
SELECT ST_AsGeoJSON(ST_Transform(ST_Intersection(lg.geometry, bbox.geom), 4326))::json As geometry, | |
( | |
SELECT row_to_json(t) | |
FROM ( | |
SELECT name, type, admin_level | |
) t | |
) | |
As properties |