Shape Escape
Well it's been a while, so just a quick note: Since the last post, I started working full time for Google. And with that out of the way, here's a post on how and why I made shpescape.com, which lets you upload shapefiles to Google Fusion Tables.
Why shpescape?
Google Fusion tables makes it easy to import and visualize data from spreadsheets and KML, and while it has increasingly robust spatial support it does not currently let you upload shapefiles directly. And since shapefiles are still incredibly common in the wild, I thought I'd make a quick tool to let people upload shapefiles to Fusion Tables.Which platform?
I thought I'd try Google App Engine to avoid any hosting costs (given this will likely not be an extremely popular website), but while there's a decent shapefile reader or two for python, there's not a lot of support for things like reprojecting and other geometry manipulation without additional c++ libraries that App Engine won't run. So I just went for a simple GeoDjango app.Authentication
I used my colleague Kathryn's Fusion Tables python client to handle the authentication (OAuth). And I decided against having OpenID in the mix as well for actually associating an account with various uploads. The downside is that you can't log in and view your previous uploads. But you can always go to the main Fusion Tables page to see all your tables, and the upside was one less thing for me to consider (for example, if you are logged in with multiple accounts in the same browser, OAuth does not return which account gave permissions for). [Edit: It turns out you can actually request the email address of an authorized user using the scope noted at http://sites.google.com/site/oauthgoog/Home/emaildisplayscope]Handling a Shapefile Upload
I used a simple fork of Dane Springmeyer's django-shapes app to handle the shapefile import. The customizations let users upload a zipfile that has a shapefile in a subfolder, and/or multiple shapefiles in a single zip. I had never really noticed shapefiles being zipped up this way, and it really surprised me how common these scenarios are with shapefiles from various US counties and other agencies -- my first 3 test users all had their uploads fail until I added this. After the upload is verified as valid, it creates a shapeUpload object, which is processed separately so the end user can view a reloading page with updated status.Processing the Upload
My initial attempt was pretty straightforward:- Attempt to get the projection of the shapefile (from the .prj)
- For each feature, get it's KML and attributes
- Upload 'em to Fusion Tables, ensuring a max of a few hundred, or <1MB, at a time (the API can handle at most 500 rows and 1MB per POST)
Additional Features
Next up, I started adding a few extra bits, which led to an import method begging for a refactor.- Simplification for KML over 1M characters long (which is the max characters allowed by Fusion Tables per cell)
- Process/Upload 10k rows at a time (so we don't use too much memory for very large shapefiles)
- Added numeric styling columns for string fields that don't have too many unique values (Fusion Tables only allows robust styling like gradients and buckets on numeric fields)
- Allow users to specify some additional geometry columns:
- Simplified Geometry
- Centroid (only works for polygon shapefiles)
- Buffered Centroid (so you can apply the more robust polygon styling rules on the 'centroid')
Comments
tech
MyAssignmentHelp
visit here - Desi Call Recordings in Hindi
Java Training in Chennai
Java Course in Chennai
website: Global 5G Infrastructure Market
Speedify Crack
Website : Best CRM for Small Businesses |
ufabet
ufa
พวงหรีด
โควิด
be shared across the internet. Thank you for sharing such a useful post. Very Interesting Post! I regularly follow this kind of Blog.
visit this page
I’m amazed, I have to admit. Rarely do I come across a blog that’s both equally educative and entertaining, and let me tell you, you have hit the nail on the head.Thanks a lot for sharing.
Freemake Video Converter Crack
Spotify Crack
EaseUS Todo Backup Crack
Smart Game Booster Crack
Malwarebytes Crack
Guitar Pro Crack
Recover My Files Crack
Device Doctor Pro Crack
fishyfacts4u.com
fishyfacts4u.com
fishyfacts4u.com
fishyfacts4u.com
fishyfacts4u.com
fishyfacts4u.com
fishyfacts4u.com
fishyfacts4u.com
fishyfacts4u.com
fishyfacts4u.com
emagazinehub.com
emagazinehub.com
emagazinehub.com
emagazinehub.com
emagazinehub.com
emagazinehub.com
emagazinehub.com
emagazinehub.com
emagazinehub.com
emagazinehub.com
inewshunter.com
inewshunter.com
inewshunter.com
inewshunter.com
inewshunter.com
inewshunter.com
inewshunter.com
inewshunter.com
inewshunter.com
inewshunter.com
juicyfactor.com
juicyfactor.com
juicyfactor.com
juicyfactor.com
juicyfactor.com
juicyfactor.com
juicyfactor.com
juicyfactor.com
juicyfactor.com
juicyfactor.com
localnewsbuzz.com
localnewsbuzz.com
localnewsbuzz.com
localnewsbuzz.com
localnewsbuzz.com
localnewsbuzz.com
localnewsbuzz.com
localnewsbuzz.com
localnewsbuzz.com
localnewsbuzz.com
Gadgets
Gaming
Health & Fitness
Lifestyle
Movie
Music
News
Nutrition
Visit here - Used Car Dealers Peoria Il
writing tutor
comparable matter, your site got here up, it seems to be good.
clean and clear face wash
nagaland lottery sambad
https://www.assignmentachievers.com/service-detail/finance+assignment+help
https://www.assignmentachievers.com/service-detail/criminal+law+assignment+help
Good morning sir, this is great. If you want to learn more about Turkish visas you can visit on our e visa Turkey website. And read here all info about Turkey evisa online.
Best IT Training Provider