SlideShare una empresa de Scribd logo
1 de 48
Descargar para leer sin conexión
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




                                    ?

Más contenido relacionado

Similar 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
 

Similar 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

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
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
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
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
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 

Último (20)

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
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
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
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)
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 

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 ?