SlideShare uma empresa Scribd logo
1 de 48
Baixar para ler offline
Introduction     API overview         Implementation   Future development   Summary




               CloudMade Staticmaps:
                     Overview
               API, architecture and hard decisions


                                Andrii V. Mishkovskyi


                                   April 28, 2010
Introduction   API overview   Implementation   Future development   Summary




Introduction

       What is this?
       Map images of various sizes and scales

       Use cases
           JavaScript-less environments
           Printable maps
           Not using slow CloudMade tiles ;)
Introduction   API overview   Implementation   Future development   Summary


Getting maps



Overview


       URL
       http://staticmaps.cloudmade.com
       /<API key>/staticmaps?
       size=<widthxheight>&styleid=<style
       id>
Introduction   API overview   Implementation   Future development   Summary


Getting maps



Overview


       Parameters
        API key CloudMade user API key
            size Sets the width and the height of the
                 image
         styleid Sets the style of the map
Introduction   API overview   Implementation   Future development   Summary


Getting maps



Specifying area



       Specify center and zoom
       size=800x600&
       center=51.47,0.0&
       zoom=14
Introduction   API overview   Implementation   Future development   Summary


Getting maps



Specifying area
Introduction   API overview   Implementation   Future development   Summary


Getting maps



Specifying area



       Specify bounding box
       size=800x600&
       bbox=51.475,-0.02,51.479,0.02
Introduction   API overview   Implementation   Future development   Summary


Getting maps



Specifying area
Introduction   API overview   Implementation   Future development   Summary


Getting maps



Specifying area



       Implicit area calculation
       size=800x600&
       path=51.48,-0.02|51.48,0.02|
       51.465,0.0|51.48,-0.02
Introduction   API overview   Implementation   Future development   Summary


Getting maps



Specifying area
Introduction   API overview   Implementation   Future development   Summary


Getting maps



Paths


       Options
          weight Width of the line
            color Color of the line
         opacity Level of opacity of the line
               fill Color of the inner polygon
       fill-opacity Level of opacity of the inner polygon
Introduction   API overview   Implementation   Future development   Summary


Getting maps



Paths


       Line example
       size=800x600&
       path=
       color:red|weight:10|opacity:0.6|
       51.46,-0.02|51.48,0.02
Introduction   API overview   Implementation   Future development   Summary


Getting maps



Paths
Introduction   API overview   Implementation   Future development   Summary


Getting maps



Paths


       Polygon example
       size=800x600&
       path=
       color:red|weight:10|opacity:0.6|
       fill:blue|
       51.46,-0.02|51.48,0.02|51.46,0.02
Introduction   API overview   Implementation   Future development   Summary


Getting maps



Paths
Introduction   API overview   Implementation   Future development   Summary


Getting maps



Markers

       Styling options
             size Size of the marker image (small,
                  mid or big)
            label Any letter in [a-Z] range or number
                  in range 0-99)
            color 8 predefined colors
        opacity 0.0 for completely transparent, 1.0
                  for completely opaque
Introduction   API overview   Implementation   Future development   Summary


Getting maps



Markers

       Example
       size=800x600&
       center=51.47,0.0&
       zoom=14&
       marker=51.47731,0.0|
       label:S|
       size:big|
       color:red|
       opacity:0.6
Introduction   API overview   Implementation   Future development   Summary


Getting maps



Markers
Introduction   API overview   Implementation   Future development   Summary


Getting maps



Markers

       Two markers, same style
       size=800x600&
       center=51.47,0.0&
       zoom=14&
       marker=51.47731,0.0|51.465,0.15|
       label:S|
       size:big|
       color:red|
       opacity:0.6
Introduction   API overview   Implementation   Future development   Summary


Getting maps



Markers
Introduction   API overview   Implementation   Future development   Summary


Getting maps



Markers

       Two markers, different style
       size=800x600&
       center=51.47,0.0&
       zoom=14&
       marker=51.47731,0.0|
       label:A|color:red&
       marker=51.465,-0.005|
       label:B|color:darkblue
Introduction   API overview   Implementation   Future development   Summary


Getting maps



Markers
Introduction   API overview   Implementation   Future development   Summary


Getting maps



Custom markers


       URL of the image
       marker=url:<url of the
       image>|<coords and other options>

       Upload and use assigned id
       marker=id:<assigned id>|<coords and
       other options>
Introduction   API overview   Implementation   Future development   Summary


Getting maps



Custom markers


       Example
       size=800x600&
       center=51.477222,0&
       zoom=14&
       marker=
       51.473,0.0|opacity:0.65|
       url:http://i.imgur.com/s3ZfB.png
Introduction   API overview   Implementation   Future development   Summary


Getting maps



Custom markers
Introduction   API overview   Implementation   Future development   Summary


Getting maps



Custom markers



       Uploading image
       $ curl -XPOST http://.../marker -F
       image=@image.png
       f4f539ec97354a5c9eeb8fbe464b767c
Introduction   API overview   Implementation   Future development   Summary


Getting maps



Custom markers


       Using id
       size=800x600&
       center=51.477222,0&
       zoom=14&
       marker=51.477222,0.0|
       id:f4f539ec97354a5c9eeb8fbe464b767c
Introduction   API overview   Implementation   Future development   Summary


Getting maps



Custom markers
Introduction     API overview   Implementation   Future development   Summary


Getting maps



Custom markers




               MAH FACE IZ AMAZING
Introduction            API overview   Implementation   Future development   Summary


Competitor’s services



Google Maps

       Cons
          Quite small set of APIs
          Lots of restrictions

       Pros
           Integrated geocoding
           Amazing speed
           Unbelievable performance
           I mean, it’s really freaking fast
Introduction            API overview   Implementation   Future development   Summary


Competitor’s services



MapQuest

       Cons
          No opacity support
          No POST support

       Pros
           Decluttering of labels
           Integrated geocoding (USA-only)
           Traffic information
Introduction      API overview   Implementation   Future development   Summary


Initial



Initial approach


               Every request gets processed by one
               render
               Render simply calls Mapnik rendering
               utilities
               Mapnik does the magic
Introduction      API overview   Implementation   Future development   Summary


Initial



Mapnik rendering
          Pros
              Easy to use
              Initial implementation took 4 days
              Drawing paths and labels is a built-in

          Cons
             Slow (0.2 - 10 seconds to render one
             image)
             Non-scalable (depends on database
             scalability)
Introduction      API overview   Implementation   Future development   Summary


Current



Why rewrite?


               Mapnik-based solution is not cacheable
               We need speed for staticmaps
               ...and scalability
               “Render less” strategy
Introduction      API overview   Implementation   Future development   Summary


Current



Rendering from cache



               Consolidation of cache management
               Fast
               Scales easily when no cache available
Introduction    API overview   Implementation   Future development   Summary


Comparing




       Figure: Zeus decides which instance should take care of
       the request
Introduction    API overview   Implementation   Future development   Summary


Comparing




       Figure: nginx checks the cache and if none found passes
       request further through FCGI
Introduction    API overview   Implementation   Future development   Summary


Comparing




       Figure: Tilman then translates HTTP request into triton
       request and checks it
Introduction        API overview   Implementation   Future development   Summary


Comparing




               Figure: Triton dispatches request to the render(s)
Introduction      API overview   Implementation   Future development   Summary


Comparing




               Figure: Old implementation is pretty inefficient
Introduction    API overview   Implementation   Future development   Summary


Comparing




       Figure: New implementation takes advantage of all
       available rendering capabilities
Introduction      API overview   Implementation   Future development   Summary


Performance



More caching?



               Using bigger/smaller tiles
               Braking tiles into several layers
               Having cached staticmaps images in two
               layers – markers + paths and base image
Introduction      API overview   Implementation   Future development   Summary


Performance



More scalability?


               Using EC2 capabilities to instantly launch
               new renders in case of high load
               Using PgPool II for DB scaling
               Using NoSQL databases instead of
               PostGIS for ease of scaling
Introduction      API overview   Implementation   Future development   Summary


API



Overall



               Geocoding integration
               Non-discrete zooms (free scale selection)
Introduction      API overview   Implementation   Future development   Summary


API



More path options


               Drawing primitives – circles, polylines,
               multipolygons
               Automatic routing integration
               Line caps and joins selection
               Using geohashes for shorter requests
Introduction      API overview   Implementation   Future development   Summary


API



Markers improvements


               More default markers
               Decluttering and grouping
               Marker offsets
               Scale and transform abilities
               Shades
Introduction      API overview   Implementation   Future development   Summary




Summary



               Staticmaps is a cool service to implement
               It’s still a very developing piece of code
               I hope it’s usable
Introduction   API overview   Implementation   Future development   Summary




                                    ?

Mais conteúdo relacionado

Semelhante a Staticmaps cloudmade-internal-april-2009

Specialist-ArcGIS-Server-API-3.x-and-4-for-JavaScript.pdf
Specialist-ArcGIS-Server-API-3.x-and-4-for-JavaScript.pdfSpecialist-ArcGIS-Server-API-3.x-and-4-for-JavaScript.pdf
Specialist-ArcGIS-Server-API-3.x-and-4-for-JavaScript.pdfRichitar1
 
Open Source Web Mapping Servers: Which horse for which course?
Open Source Web Mapping Servers: Which horse for which course?Open Source Web Mapping Servers: Which horse for which course?
Open Source Web Mapping Servers: Which horse for which course?antscott
 
DSL (Domain Specific Language) for Maps Mashups
DSL (Domain Specific Language) for Maps MashupsDSL (Domain Specific Language) for Maps Mashups
DSL (Domain Specific Language) for Maps Mashupsaliraza786
 
Scaling Application
Scaling ApplicationScaling Application
Scaling ApplicationAlaor Bianco
 
Sap Process Integration
Sap Process Integration Sap Process Integration
Sap Process Integration Tauhidul Islam
 
TelerikNEXT What's new in UI for ASP.NET AJAX
TelerikNEXT What's new in UI for ASP.NET AJAXTelerikNEXT What's new in UI for ASP.NET AJAX
TelerikNEXT What's new in UI for ASP.NET AJAXEd Charbeneau
 
Maciej Treder "Server-side rendering with Angular—be faster and more SEO, CDN...
Maciej Treder "Server-side rendering with Angular—be faster and more SEO, CDN...Maciej Treder "Server-side rendering with Angular—be faster and more SEO, CDN...
Maciej Treder "Server-side rendering with Angular—be faster and more SEO, CDN...Fwdays
 
Online mapping with_the_google_maps_api
Online mapping with_the_google_maps_apiOnline mapping with_the_google_maps_api
Online mapping with_the_google_maps_apiCelny Quispe
 
Building Mobile Dashboards With D3 and Google Charts
Building Mobile Dashboards With D3 and Google ChartsBuilding Mobile Dashboards With D3 and Google Charts
Building Mobile Dashboards With D3 and Google ChartsSalesforce Developers
 
Oracle apex training
Oracle apex trainingOracle apex training
Oracle apex trainingVasudha India
 
FaaS Automation and Infrastructure
FaaS Automation and Infrastructure FaaS Automation and Infrastructure
FaaS Automation and Infrastructure Mohamad Al moualem
 
HTML Online Course HTML Course Online online html courses html online training
HTML Online Course  HTML Course Online online html courses html online trainingHTML Online Course  HTML Course Online online html courses html online training
HTML Online Course HTML Course Online online html courses html online trainingEvanta Technologies
 
NVIDIA OpenGL in 2016
NVIDIA OpenGL in 2016NVIDIA OpenGL in 2016
NVIDIA OpenGL in 2016Mark Kilgard
 
Best SAP PI Online Training Instituteq
Best SAP PI Online Training InstituteqBest SAP PI Online Training Instituteq
Best SAP PI Online Training InstituteqVirtual Nuggets
 
Single page application and canvas drawing
Single page application and canvas drawing Single page application and canvas drawing
Single page application and canvas drawing IJwest
 
Introducing Neo4j 3.0
Introducing Neo4j 3.0Introducing Neo4j 3.0
Introducing Neo4j 3.0Neo4j
 
Que hay de nuevo en Visual Studio 2013 y ASP.NET 5.1
Que hay de nuevo en Visual Studio 2013 y ASP.NET 5.1Que hay de nuevo en Visual Studio 2013 y ASP.NET 5.1
Que hay de nuevo en Visual Studio 2013 y ASP.NET 5.1Rodolfo Finochietti
 

Semelhante a Staticmaps cloudmade-internal-april-2009 (20)

Specialist-ArcGIS-Server-API-3.x-and-4-for-JavaScript.pdf
Specialist-ArcGIS-Server-API-3.x-and-4-for-JavaScript.pdfSpecialist-ArcGIS-Server-API-3.x-and-4-for-JavaScript.pdf
Specialist-ArcGIS-Server-API-3.x-and-4-for-JavaScript.pdf
 
Open Source Web Mapping Servers: Which horse for which course?
Open Source Web Mapping Servers: Which horse for which course?Open Source Web Mapping Servers: Which horse for which course?
Open Source Web Mapping Servers: Which horse for which course?
 
DSL (Domain Specific Language) for Maps Mashups
DSL (Domain Specific Language) for Maps MashupsDSL (Domain Specific Language) for Maps Mashups
DSL (Domain Specific Language) for Maps Mashups
 
Scaling Application
Scaling ApplicationScaling Application
Scaling Application
 
Sap Process Integration
Sap Process Integration Sap Process Integration
Sap Process Integration
 
TelerikNEXT What's new in UI for ASP.NET AJAX
TelerikNEXT What's new in UI for ASP.NET AJAXTelerikNEXT What's new in UI for ASP.NET AJAX
TelerikNEXT What's new in UI for ASP.NET AJAX
 
Maciej Treder "Server-side rendering with Angular—be faster and more SEO, CDN...
Maciej Treder "Server-side rendering with Angular—be faster and more SEO, CDN...Maciej Treder "Server-side rendering with Angular—be faster and more SEO, CDN...
Maciej Treder "Server-side rendering with Angular—be faster and more SEO, CDN...
 
Online mapping with_the_google_maps_api
Online mapping with_the_google_maps_apiOnline mapping with_the_google_maps_api
Online mapping with_the_google_maps_api
 
Open layers
Open layersOpen layers
Open layers
 
Building Mobile Dashboards With D3 and Google Charts
Building Mobile Dashboards With D3 and Google ChartsBuilding Mobile Dashboards With D3 and Google Charts
Building Mobile Dashboards With D3 and Google Charts
 
Oracle apex training
Oracle apex trainingOracle apex training
Oracle apex training
 
Location Based Services Without the Cocoa
Location Based Services Without the CocoaLocation Based Services Without the Cocoa
Location Based Services Without the Cocoa
 
FaaS Automation and Infrastructure
FaaS Automation and Infrastructure FaaS Automation and Infrastructure
FaaS Automation and Infrastructure
 
HTML Online Course HTML Course Online online html courses html online training
HTML Online Course  HTML Course Online online html courses html online trainingHTML Online Course  HTML Course Online online html courses html online training
HTML Online Course HTML Course Online online html courses html online training
 
NVIDIA OpenGL in 2016
NVIDIA OpenGL in 2016NVIDIA OpenGL in 2016
NVIDIA OpenGL in 2016
 
Best SAP PI Online Training Instituteq
Best SAP PI Online Training InstituteqBest SAP PI Online Training Instituteq
Best SAP PI Online Training Instituteq
 
Single page application and canvas drawing
Single page application and canvas drawing Single page application and canvas drawing
Single page application and canvas drawing
 
Api design part 1
Api design part 1Api design part 1
Api design part 1
 
Introducing Neo4j 3.0
Introducing Neo4j 3.0Introducing Neo4j 3.0
Introducing Neo4j 3.0
 
Que hay de nuevo en Visual Studio 2013 y ASP.NET 5.1
Que hay de nuevo en Visual Studio 2013 y ASP.NET 5.1Que hay de nuevo en Visual Studio 2013 y ASP.NET 5.1
Que hay de nuevo en Visual Studio 2013 y ASP.NET 5.1
 

Último

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 

Último (20)

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 

Staticmaps cloudmade-internal-april-2009

  • 1. Introduction API overview Implementation Future development Summary CloudMade Staticmaps: Overview API, architecture and hard decisions Andrii V. Mishkovskyi April 28, 2010
  • 2. Introduction API overview Implementation Future development Summary Introduction What is this? Map images of various sizes and scales Use cases JavaScript-less environments Printable maps Not using slow CloudMade tiles ;)
  • 3. Introduction API overview Implementation Future development Summary Getting maps Overview URL http://staticmaps.cloudmade.com /<API key>/staticmaps? size=<widthxheight>&styleid=<style id>
  • 4. Introduction API overview Implementation Future development Summary Getting maps Overview Parameters API key CloudMade user API key size Sets the width and the height of the image styleid Sets the style of the map
  • 5. Introduction API overview Implementation Future development Summary Getting maps Specifying area Specify center and zoom size=800x600& center=51.47,0.0& zoom=14
  • 6. Introduction API overview Implementation Future development Summary Getting maps Specifying area
  • 7. Introduction API overview Implementation Future development Summary Getting maps Specifying area Specify bounding box size=800x600& bbox=51.475,-0.02,51.479,0.02
  • 8. Introduction API overview Implementation Future development Summary Getting maps Specifying area
  • 9. Introduction API overview Implementation Future development Summary Getting maps Specifying area Implicit area calculation size=800x600& path=51.48,-0.02|51.48,0.02| 51.465,0.0|51.48,-0.02
  • 10. Introduction API overview Implementation Future development Summary Getting maps Specifying area
  • 11. Introduction API overview Implementation Future development Summary Getting maps Paths Options weight Width of the line color Color of the line opacity Level of opacity of the line fill Color of the inner polygon fill-opacity Level of opacity of the inner polygon
  • 12. Introduction API overview Implementation Future development Summary Getting maps Paths Line example size=800x600& path= color:red|weight:10|opacity:0.6| 51.46,-0.02|51.48,0.02
  • 13. Introduction API overview Implementation Future development Summary Getting maps Paths
  • 14. Introduction API overview Implementation Future development Summary Getting maps Paths Polygon example size=800x600& path= color:red|weight:10|opacity:0.6| fill:blue| 51.46,-0.02|51.48,0.02|51.46,0.02
  • 15. Introduction API overview Implementation Future development Summary Getting maps Paths
  • 16. Introduction API overview Implementation Future development Summary Getting maps Markers Styling options size Size of the marker image (small, mid or big) label Any letter in [a-Z] range or number in range 0-99) color 8 predefined colors opacity 0.0 for completely transparent, 1.0 for completely opaque
  • 17. Introduction API overview Implementation Future development Summary Getting maps Markers Example size=800x600& center=51.47,0.0& zoom=14& marker=51.47731,0.0| label:S| size:big| color:red| opacity:0.6
  • 18. Introduction API overview Implementation Future development Summary Getting maps Markers
  • 19. Introduction API overview Implementation Future development Summary Getting maps Markers Two markers, same style size=800x600& center=51.47,0.0& zoom=14& marker=51.47731,0.0|51.465,0.15| label:S| size:big| color:red| opacity:0.6
  • 20. Introduction API overview Implementation Future development Summary Getting maps Markers
  • 21. Introduction API overview Implementation Future development Summary Getting maps Markers Two markers, different style size=800x600& center=51.47,0.0& zoom=14& marker=51.47731,0.0| label:A|color:red& marker=51.465,-0.005| label:B|color:darkblue
  • 22. Introduction API overview Implementation Future development Summary Getting maps Markers
  • 23. Introduction API overview Implementation Future development Summary Getting maps Custom markers URL of the image marker=url:<url of the image>|<coords and other options> Upload and use assigned id marker=id:<assigned id>|<coords and other options>
  • 24. Introduction API overview Implementation Future development Summary Getting maps Custom markers Example size=800x600& center=51.477222,0& zoom=14& marker= 51.473,0.0|opacity:0.65| url:http://i.imgur.com/s3ZfB.png
  • 25. Introduction API overview Implementation Future development Summary Getting maps Custom markers
  • 26. Introduction API overview Implementation Future development Summary Getting maps Custom markers Uploading image $ curl -XPOST http://.../marker -F image=@image.png f4f539ec97354a5c9eeb8fbe464b767c
  • 27. Introduction API overview Implementation Future development Summary Getting maps Custom markers Using id size=800x600& center=51.477222,0& zoom=14& marker=51.477222,0.0| id:f4f539ec97354a5c9eeb8fbe464b767c
  • 28. Introduction API overview Implementation Future development Summary Getting maps Custom markers
  • 29. Introduction API overview Implementation Future development Summary Getting maps Custom markers MAH FACE IZ AMAZING
  • 30. Introduction API overview Implementation Future development Summary Competitor’s services Google Maps Cons Quite small set of APIs Lots of restrictions Pros Integrated geocoding Amazing speed Unbelievable performance I mean, it’s really freaking fast
  • 31. Introduction API overview Implementation Future development Summary Competitor’s services MapQuest Cons No opacity support No POST support Pros Decluttering of labels Integrated geocoding (USA-only) Traffic information
  • 32. Introduction API overview Implementation Future development Summary Initial Initial approach Every request gets processed by one render Render simply calls Mapnik rendering utilities Mapnik does the magic
  • 33. Introduction API overview Implementation Future development Summary Initial Mapnik rendering Pros Easy to use Initial implementation took 4 days Drawing paths and labels is a built-in Cons Slow (0.2 - 10 seconds to render one image) Non-scalable (depends on database scalability)
  • 34. Introduction API overview Implementation Future development Summary Current Why rewrite? Mapnik-based solution is not cacheable We need speed for staticmaps ...and scalability “Render less” strategy
  • 35. Introduction API overview Implementation Future development Summary Current Rendering from cache Consolidation of cache management Fast Scales easily when no cache available
  • 36. Introduction API overview Implementation Future development Summary Comparing Figure: Zeus decides which instance should take care of the request
  • 37. Introduction API overview Implementation Future development Summary Comparing Figure: nginx checks the cache and if none found passes request further through FCGI
  • 38. Introduction API overview Implementation Future development Summary Comparing Figure: Tilman then translates HTTP request into triton request and checks it
  • 39. Introduction API overview Implementation Future development Summary Comparing Figure: Triton dispatches request to the render(s)
  • 40. Introduction API overview Implementation Future development Summary Comparing Figure: Old implementation is pretty inefficient
  • 41. Introduction API overview Implementation Future development Summary Comparing Figure: New implementation takes advantage of all available rendering capabilities
  • 42. Introduction API overview Implementation Future development Summary Performance More caching? Using bigger/smaller tiles Braking tiles into several layers Having cached staticmaps images in two layers – markers + paths and base image
  • 43. Introduction API overview Implementation Future development Summary Performance More scalability? Using EC2 capabilities to instantly launch new renders in case of high load Using PgPool II for DB scaling Using NoSQL databases instead of PostGIS for ease of scaling
  • 44. Introduction API overview Implementation Future development Summary API Overall Geocoding integration Non-discrete zooms (free scale selection)
  • 45. Introduction API overview Implementation Future development Summary API More path options Drawing primitives – circles, polylines, multipolygons Automatic routing integration Line caps and joins selection Using geohashes for shorter requests
  • 46. Introduction API overview Implementation Future development Summary API Markers improvements More default markers Decluttering and grouping Marker offsets Scale and transform abilities Shades
  • 47. Introduction API overview Implementation Future development Summary Summary Staticmaps is a cool service to implement It’s still a very developing piece of code I hope it’s usable
  • 48. Introduction API overview Implementation Future development Summary ?