Skip to content

Instantly share code, notes, and snippets.

View cageyjames's full-sized avatar

James Fee cageyjames

View GitHub Profile
#!/usr/bin/env python
###############################################################################
# $Id$
#
# Project: GDAL2Tiles, Google Summer of Code 2007 & 2008
# Global Map Tiles Classes
# Purpose: Convert a raster into TMS tiles, create KML SuperOverlay EPSG:4326,
# generate a simple HTML viewers based on Google Maps and OpenLayers
# Author: Klokan Petr Pridal, klokan at klokan dot cz
# Web: http://www.klokan.cz/projects/gdal2tiles/
[
200,
{
"preview_layer_api_url": "https://market.weogeo.com/datasets/topo-usgs-drg-topo-felton-ca/preview_layers.json",
"rating": 0.0,
"supported_customizations": {
"layer": false,
"file_format": true,
"projection_datum": true,
"geocrop": true,
Jamess-MacBook-Pro:Desktop james$ python submitjob.py
making jobs
Submitting your jobs...
Here is your order info:
{
"job": {
"dataset_token": "f1bca22c-013e-4e57-a78b-f9bbb3a918e8",
@cageyjames
cageyjames / outputurls.py
Created December 24, 2012 20:14
Get all the URLs for my blog (http://www.spatiallyadjusted.com)
#!/usr/bin/env python
from bs4 import BeautifulSoup
import urllib2
url = "http://www.spatiallyadjusted.com/blog/archives/"
page = urllib2.urlopen(url)
soup = BeautifulSoup(page.read())
file = open('out.txt', 'w')
@cageyjames
cageyjames / DownloadJobWeoGeo.py
Last active December 10, 2015 01:09
Code example on how to find the download URL for a specific job.
#!/usr/bin/env python
""" see previous example on how to submit jobs to be ordered (https://gist.github.com/4356165)
For this example we take a job create and submit it to WeoGeo to generate an order. Looking at the
token field in the JSON, I've picked this TOPO Raster token "a32957481fde138c22c38a680f2ec65".
The dataset can be viewed here: http://market.weogeo.com/datasets/a32957481fde138c22c38a680f2ec65 """
print "\nConnecting to WeoGeo...\n"
@cageyjames
cageyjames / OrderJobsinCartWeoGeo.py
Last active December 10, 2015 01:09
Code example on how to order all jobs in your WeoGeo cart.
#!/usr/bin/env python
""" see previous example on how to an order for a dataset (https://gist.github.com/4355769)
For this example we take a job create and submit it to WeoGeo to generate an order. Looking at the token
field in the JSON, I've picked this TOPO Raster token "a32957481fde138c22c38a680f2ec65". The dataset
can be viewed here: http://market.weogeo.com/datasets/a32957481fde138c22c38a680f2ec65 """
print "\nConnecting to WeoGeo...\n"
{
"layers": null,
"status": "Not Processed",
"events_api_url": "https://market.weogeo.com/jobs/4870e9c5-7292-4592-b873-4f53bf5ff6b2/events.json",
"order_url": "https://market.weogeo.com/jobs/4870e9c5-7292-4592-b873-4f53bf5ff6b2/order",
"job_edit_page_url": "https://market.weogeo.com/datasets/topo_usgs_drg_topo_four_peaks_az?job_id=4870e9c5-7292-4592-b873-4f53bf5ff6b2",
"api_url": "https://market.weogeo.com/jobs/4870e9c5-7292-4592-b873-4f53bf5ff6b2.json",
"parameters": {
"job_geocrop": "Clip",
"job_east": -12386121.607448,
@cageyjames
cageyjames / GenerateJobWeoGeo.py
Last active December 10, 2015 01:08
Code example on how to connect to the WeoGeo Market and a job order for a dataset.
#!/usr/bin/env python
""" see previous example on how to get a dataset (https://gist.github.com/4355190)
For this example we take a dataset found previously and order it from WeoGeo. Looking at the token
field in the JSON, I've picked this TOPO Raster token "a32957481fde138c22c38a680f2ec65". The dataset
can be viewed here: http://market.weogeo.com/datasets/a32957481fde138c22c38a680f2ec65 """
import WeoGeoAPI
@cageyjames
cageyjames / GetDataSetInfoWeoGeo.py
Last active December 10, 2015 00:59
Code example on how to connect to the WeoGeo Market and return a JSON string about a specific dataset.
#!/usr/bin/env python
""" see previous example on how to get a dataset (https://gist.github.com/4355190)
For this example we take a dataset found previously and get more information about it. Looking
at the token field in the JSON, I've picked this TOPO Raster token "a32957481fde138c22c38a680f2ec65".
The dataset can be viewed here: http://market.weogeo.com/datasets/a32957481fde138c22c38a680f2ec65 """
print "\nConnecting to WeoGeo...\n"
@cageyjames
cageyjames / FindDataOnWeoGeoMarket.py
Last active December 10, 2015 00:59
Code example on how to connect to the WeoGeo Market and return a JSON string with your datasets
#!/usr/bin/env python
""" This sample code will allow you to connect to the WeoGeo Market and get a list of datasets.
You'll need the WeoGeo Python API that can be acquired by "pip install WeoGeoAPI". """
print "\nConnecting to WeoGeo...\n"
# Import Needed Libraries
import WeoGeoAPI