This file contains hidden or 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
THEME | FORMAT | SOURCE | LINK | |
---|---|---|---|---|
roads, waterways, building footprints, points of interest | shp, pbf | OpenStreetMap (OSM) | http://download.geofabrik.de/asia/philippines.html | |
administrative boundaries (country, region, province, municipality, city) | shp | PSA, NAMRIA, DROMIC, UNOCHA, and patners | https://data.humdata.org/dataset/philippines-administrative-levels-0-to-3 | |
administrative boundaries (barangay) | shp | PSA, NAMRIA, DROMIC, UNOCHA, and patners | https://data.humdata.org/dataset/philippines-admin4-boundaries-barangay | |
framework data (boundaries, roads, elevation, population, etc.) | various | DIVA-GIS | http://www.diva-gis.org/gdata | |
topographic maps (1:50,000 and 1:250,000) | non-georeferenced raster | NAMRIA | http://www.namria.gov.ph/download.php | |
various geohazards | shp | NOAH | http://noah.up.edu.ph/downloads/ | |
various geohazards | shp | DREAM | https://lipad.dream.upd.edu.ph/ | |
various geohazards | shp | MGB | http://www.namria.gov.ph/download.php | |
various geohazards | shp | PHIVOLCS | http://www.phivolcs.dost.gov.ph/ |
This file contains hidden or 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
# Enable syntax highlighting in vim + tmux | |
export TERM="xterm-256color" |
This file contains hidden or 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
def get_image_data(request, id): | |
person = Person.objects.get(id=id) | |
try: | |
image_data = persion.image.open().read() | |
except FileNotFoundError: | |
raise FileNotFoundError('File not found') | |
content_type = mimetypes.guess_type(person.image.path) | |
return HttpResponse(image_data, content_type=content_type) |
This file contains hidden or 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
import scrapy | |
class CrawlerItem(scrapy.Item): | |
title = scrapy.Field() | |
link = scrapy.Field() | |
body = scrapy.Field() | |
def parse_article(response): |
This file contains hidden or 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
import json | |
import re | |
import scrapy | |
class CrawlerItem(scrapy.Item): | |
title = scrapy.Field() | |
link = scrapy.Field() | |
body = scrapy.Field() |
This file contains hidden or 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
import scrapy | |
class CrawlerItem(scrapy.Item): | |
title = scrapy.Field() | |
link = scrapy.Field() | |
body = scrapy.Field() | |
def parse_article(response): |
This file contains hidden or 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
import scrapy | |
class CrawlerItem(scrapy.Item): | |
title = scrapy.Field() | |
link = scrapy.Field() | |
body = scrapy.Field() | |
def parse_article(response): |
This file contains hidden or 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
import scrapy | |
class CrawlerItem(scrapy.Item): | |
title = scrapy.Field() | |
link = scrapy.Field() | |
body = scrapy.Field() | |
def parse_article(response): |
This file contains hidden or 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
def trimf(x, points): | |
pointA = points[0] | |
pointB = points[1] | |
pointC = points[2] | |
slopeAB = getSlope(pointA, 0, pointB, 1) | |
slopeBC = getSlope(pointB, 1, pointC, 0) | |
result = 0 | |
if x >= pointA and x <= pointB: | |
result = slopeAB * x + getYIntercept(pointA, 0, pointB, 1) | |
elif x >= pointB and x <= pointC: |