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

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
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
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
 
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
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
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
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
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
 
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
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 

Último (20)

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
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
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
 
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
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
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
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
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
 
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
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 

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 ?