Quantcast
Channel: CARTO Blog
Viewing all 820 articles
Browse latest View live

Creating a Layer Selector: Crime in the U.S.A.

$
0
0

Layer Selector header

Making maps can be a challenge. Whether you’re just getting started with the CartoDB Editor or you’re a seasoned geo-spatial developer using the CartoDB Platform, The tools that CartoDB offers allows for incredible versatility in how data is visualized, analyzed and made interactive. Just take a look at some of the awesome use-cases in our gallery!

In making complex maps, our JavaScript library - CartoDB.js - makes it easy to work with to your data tables and maps stored in CartoDB. CartoDB.js allows you to connect to your stored visualizations, create new visualizations, add custom interaction, and query your raw data from a web browser. Check out this map of different crimes by the numbers is the United States built using both the editor and CartoDB.js library:


Crime Map


One feature of the map above, and possibly the most requested functionality achieved through using our JavaScript library, is the ability to create a layer selector from your visualization layers in the editor. CartoDB.js makes this easy by allowing you to access your map layers, stylings and data with a few simple lines of code and your vizjson.

Making a layer and legend selector using CartoDB.js

Making the buttons


Layers

Once you have your layers organized in the CartoDB editor, and finish setting up your coding environment, the first step in creating a layer selector is to create the buttons where the user can interact with the createSelector function on your visualization.

<divid="cartocss"class="layer_selector"><pid="js-crime-selector">CRIME SELECTOR</p><ulclass="LayerSelector-list"><lidata="0"class="vio">Total Violent Crime
                </li><lidata="1"class="vio">Aggravated Assault
                </li><lidata="2">Property Crime
                </li><lidata="3">Burglary
                </li><lidata="4">Motor Vehicle Theft
                </li><lidata="5"class="vio">Murder/Non-Negligibe Homicide
                </li><lidata="6">Larceny Theft
                </li><lidata="7">Robbery
                </li></ul></div>

The data attribute, which is essential for the layer selector, corresponds with the layer order in the editor. If you take a look at the image above and compare it to the HTML, you can see how these elements correlate.

The HTML buttons also contain a class attribute that corresponds with whether the crime is violent or not violent. This is used for toggling the legends, which are created as JavaScript objects with the default set to non-violent.

vardensityLegend=newcdb.geo.ui.Legend.Density({title:"<a href='http://www.fbi.gov/about-us/cjis/ucr/ucr'>Data From FBI Crime Reporting 2013</a>",left:"Low",right:"High",colors:["#FFFFB2","#FED976","#FEB24C","#FD8D3C","#FC4E2A","#E31A1C","#B10026"]});$('#map').append(densityLegend.render().el);// Hide the legend for Violent crimes by default$(densityLegend.render().el).hide()vardensityLegendNon=newcdb.geo.ui.Legend.Density({title:"<a href='http://www.fbi.gov/about-us/cjis/ucr/ucr'>Data From FBI Crime Reporting 2013</a>",left:"Low",right:"High",colors:["#FFFFCC","#C7E9B4","#7FCDBB","#41B6C4","#1D91C0","#225EA8","#0C2C84"]});$('#map').append(densityLegendNon.render().el);

Bringing in your data layers

For our Criminal States map, the code below does a few things.

cartodb.createLayer(map_object,'http://team.cartodb.com/api/v2/viz/5a9a49ce-b3a9-11e4-921d-0e9d821ea90d/viz.json').addTo(map_object).done(function(layer){$("li").on('click',function(e){varnum=+$(e.target).attr('data');createSelector(layer,num,$(e.target).hasClass('vio'));});})

First it brings in the vizjson and adds it to the map_object variable reproducing your visualization. It then identifies that the layers correspond with with the clickable list items in your HTML buttons using the data attribute as the num variable as the identifier. Lastly, it identifies that the createSelector function is determined by the layer in relationship to the data attribute (num) and whether the selected layer is a violet crime or not according to the class=”vio” attribute we set above.

Creating the selector functionality

The createSelector function brings in how all of the previously set up conditions work for the user. This function states that when when a particular layer is selected on click, that particular layer is made visible while the rest of the layers are hidden. For the violent variable, if the layer is violent, it shows the created densityLegend for violent crimes and hides the densityLegendNon which corresponds with non-violent crimes. If the layer is not violent, the inverse occurs.

// Create layer selectorfunctioncreateSelector(layer,num,violent){for(vari=0;i<layer.getSubLayerCount();i++){if(i===num){layer.getSubLayer(i).show();}else{layer.getSubLayer(i).hide();}}if(violent){$(densityLegendNon.render().el).hide()$(densityLegend.render().el).show()}else{$(densityLegend.render().el).hide()$(densityLegendNon.render().el).show()}}

The final product of all of these pieces together creates a beautiful and functional Criminal States Map!


We hope this blog post helped introduce some of the powerful possibilities of cartoDB.js. Don’t forget to keep learning with our CartoDB.js course in the Academy and check out our tutorials page for more cool examples of what’s possible with CartoDB.

Happy mapping!


WordPress now brings you beautiful maps from CartoDB

$
0
0

WordPress.com

CartoDB is now the easiest tool on the web for adding maps to your WordPress site. With over 60 million users, we wanted to make sure they had the ability to share maps with their stories and on their websites. So with some help from our friends at WordPress.com, it is now as simple as cut & paste.

If you are a WordPress user looking for adding a custom map to your webpage, skim through the CartoDB tutorials to get started. If you haven’t made a map before, head over to the Map Academy to become a pro in under an hour.

WordPress.com

If you are a CartoDB user and want to build a website to share your maps, WordPress is now a great option for you. With their awesome publishing and customization tools, you can make a webpage that you will love.

Through the same effort, it will soon be possible to add CartoDB maps to your self-hosted WordPress.org via Jetpack.

Let the WordPress mapping begin!

Aid Reports: better reporting for NGOs,and better data for everyone

$
0
0

For folks working in global development – whether in micro-finance or environmental protection or food security – one common challenge is collecting data from a huge range of far-flung projects. New technology tools are helping, though, and bringing loads of useful NGO data online.

Vizzuality, one of our partners, works with a lot of NGOs and funders. Using that experience, they created Aid Reports. Aid Reports is both a technology base and – importantly – an approach to NGO project reporting. You can learn more about Aid Reports in our March 17 webinar.

One of the many benefits of this work is that as more NGO reporting happens online, it releases datasets and other information that can really break down silos. Let’s take a look at a few Aid Reports examples:

Cash Atlas

Aided by the ability to move funds via mobile phones, cash transfer programs (CTPs) are becoming an increasingly important way to provide direct assistance during crises.

When you visit Cash Atlas, the magnitude and effects of the Syrian crisis are clear in an instant. You can see the story: Syrian refugees are pouring into Lebanon, distributing funds in Syria is incredibly difficult, and food security dwarfs other types of funding in the region.

Vizzuality developed Cash Atlas for the Cash Learning Partnership, a coalition of global aid funders. They wanted to collect cash transfer data from many funders to stay coordinated when responding to crises.

There’s a growing body of research on where and when cash transfer programmes (CTPs) are most effective, with, for example, evidence that direct cash transfers can help keep kids in school. A secondary benefit of Cash Atlas is that having this data in one place makes it easier to evaluate cash transfer programs - purposes, distribution methods (grants, vouchers, cash for work), timing, and outcomes.

Calvert Foundation

Vizzuality used Aid Reports in building the Calvert Foundation’s map of its projects and outcomes.

Spreading best practices often means connecting numbers to an effective narrative, and the ability to see the stories that come out of the projects means you can see what is happening, where, and to what benefit.

NGO Aid Map

Most everyone reading this has access to immediately useful directories of services - restaurants on Yelp or doctors on HealthGrades. But there’s no Yelp for critical services in resource-poor areas, and even data on funded NGO efforts can be hard to come by.

NGO Aid Map is a big step toward making poverty alleviation projects easier to find, assess, and work with.

Like Cash Atlas, NGO Aid Map publishes data from a huge coalition of aid organizations, and you can drill down into a country in order to learn about each of the programs in a given region. For example, in Uganda you can find food security initiatives aimed at assisting Sudanese refugees. For an organization working on similar issues in a different location, or for funders that want to learn more about the on-the-ground realities, this directory is a huge resource.

We’re excited to see how robust reporting platforms like Aid Reports can make the hard work of global development a tiny bit easier, and we’re excited to see how you use the data from these platforms in CartoDB and elsewhere. If you’re interested in learning more about Aid Reports, sign up for the March 17 webinar or just drop us a line.

Happy Mapping!

Open data and mapping at Google Campus London: a summary of CartoDBeers

$
0
0

CartoDBeers - London

As you probably know, we have a deep commitment with the open data and mapping communities. We feel supporting people and organisations passionate about the values and technologies that in the end make CartoDB possible is a good thing. And the UK is home to some of the most active open communities in the world.

This is why we were super excited to host, together with our dear friends at Illustreets, a new edition of our world famousCartoDBeers. We were lucky enough to have Google Campus as our venue this time, where we spent an awesome evening listening to great people and drinking beer. Not necessarily in that order.

Robin Hawkes spoke about the amazing work he and his startup ViziCities have been doing to gain a deeper insight into what’s happening in our cities, using open source technologies to visualise urban data in 3D from the browser.

Steve Preston demoed SkillsRoute, a tool that shows us how open data can help young people be more aware of their options, and in which ways their educational choices can evolve their careers.

Andrew Moist, from Land Insight showed an impressive tool that visualises spatially all sorts of public data, in order for people in the real estate world to identify new opportunities and leads.

A personality in the open data world, Jeni Tennison talked about the incredible work that OpenAddresses UK has been doing in order to have a freely accessible, open repository of addresses in the United Kingdom, working closely with the global chapter in America.

We ended the session with a couple of demos of the latest stuff from CartoDB, including massive polygon rendering and time-based maps with Torque, as well as some nice time afterwards talking about maps and open data. Thank you so much to all who attended, and special thanks to our great partners Illustreets, who are always a treat to host these events with.

See you at the next CartoDBeers!

Welcome Antonio

$
0
0

Antonio Zamorano

We are happy to announce Antonio Zamorano is joining CartoDB team as Systems Engineer. He will be mostly helping the team automating tasks and scaling the platform to its next level.

Antonio is originally from Madrid and he previously worked at Tuenti, the leading social network in Spain. Before that he worked in other companies as Systems and Network Administrator where he left his mark.

When he is not working with computers he loves going for a ride with his bike or motorbike. He also enjoys very much traveling and hopes to combine both soon by doing a long trip by bike… and yes, he is a man with a tidy beard.

We are thrilled about this new addition to our team, a big howdy to Antonio!

Interested in joining the CartDB team? We’re hiring.

NYC, the City That Never Sleeps

$
0
0

In 1905, the New York Times declared New York City, “the noisiest city on Earth.” Little has seemingly changed with hundreds of thousands of noise complaints logged with the city’s 311 complaint hotline every year since 2010. As a public data excerise, I created a choropleth map of 311 noise complaint data from 2014 normalized against the latest population figures from the city.

Mapping New Yorker noise complaints can only give us a spatial dimension to individual perceptions of noise. Our sense of what constitutes noise is highly personal, determined by factors such as our upbringing, community and society. Until the city attempts to measure the street noise by decibels, the only available data to work from is the city’s 311 complaint line. Here’s what I learned, and how to make your very own Noisy New York City map.

To start, I downloaded a shapefile of New York City’s neighborhood tabulation areas from the NYC OpenData portal, and 2010 census population data from the NYC Department of City Planning. After cleaning up the header rows in the 2010 census population table, I imported both datasets into CartoDB.

In the Neighborhood Tabulation Area table, I created a new empty column and used a SQL query to join 2010 census population data to the Neighborhood Tabulation Area table.

UPDATEnyntaSETpop=census2010pops.pop2010FROMcensus2010popsWHEREnynta.ntaname=census2010pops.ntaname

I downloaded 311 noise complaint data from the NYC OpenData Portal for 2014, and uploaded to CartoDB. One year’s worth of data has well over 160,000 complaints. I joined the data from the neighborhood tabulation table with the 311 noise complaint table using geospatial intersection and normalized the number of complaints against the latest census population figures for each neighborhood. (Learn more about aggregating data by geospatial intersection from this CartoDB tutorial.)

SELECT1000*s.cnt/ne.popASnormed,s.the_geom_webmercator,ne.ntanameFROMnyntane,(SELECTne.ntanameASname,ne.the_geom_webmercatorASthe_geom_webmercator,count(*)cntFROMnyntane,noisedatandWHEREST_Intersects(ne.the_geom,nd.the_geom)GROUPBYne.ntaname,ne.the_geom_webmercator)sWHEREs.name=ne.ntanameANDne.popISNOTNULLANDne.pop!=0ANDne.ntaname!~*'park-cemetery-etc'

One issue to keep in mind is the inclusion of public spaces such as parks and cemeteries. These areas are designated as “park-cemetery-etc” by borough, and not surprisingly, noise complaints are registered from these areas as well. However, with no census population data to work from for these areas, I needed a different strategy for normalizing this data.

I created a new table with the noise complaint data for the “park-cemetery-etc” neighborhoods only.

SELECTs.cnt,s.the_geom_webmercator,ne.ntanameFROMnyntane,(SELECTne.ntanameASname,ne.the_geom_webmercatorASthe_geom_webmercator,count(*)cntFROMnyntane,noisedatandWHEREST_Intersects(ne.the_geom,nd.the_geom)GROUPBYne.ntaname,ne.the_geom_webmercator)sWHEREs.name=ne.ntanameANDne.ntaname~*'park-cemetery-etc'

I normalized this data by the area of each green space, and combined as a second layer in my Noisy New York City map.

SELECTthe_geom_webmercator,cnt*1e6/ST_Area(the_geom_webmercator)AScnt_normedFROMnoiseinparks

After applying color styles unique to each layer and adding legends, the map is done! There is more that could be explored though, such as analyzing complaints by type (such as loud music or party, the most common complaint according to this more in-depth analysis of the noise complaint data by Ben Wellington of I Quant NY.)

Happy mapping!

Data.gov now allows you to "Open in CartoDB"

$
0
0

Data.gov has been publishing United States Federal Government data since 2009. Their mission is to increase public access to over 125,000 datasets they have already published and many others they are still collecting and indexing. In the years since its launch, the platform has stimulated creativity through civic hackers, technology companies, educators, and many others.

To expand the impact and remove any remaining barriers to using open data, Data.gov now allows you to make your own map from the data in a single click with an “Open in CartoDB” button on every supported dataset. This is a huge addition to the accessibility of open data because now making and exploring a map from data takes no expertise at all. On top of that, you can do it for free.

CartoDB <3 Data.gov

We hope that Data.gov is the first among many data publishers to support this killer feature. Allowing people to leverage the power of maps, filter and explore data, and publish or embed maps on their own sites will only add greater awareness to the topics addressed on the site. Check out some sample datasets in these sectors to explore the possibilities:

Try it out today and discover how easy open data can be. Congratulations to Data.gov for taking this amazing step toward easier to access open data.

Geo and the Mobile Industry: Thoughts following the Mobile World Congress

$
0
0

Miguel Arias - 4YFN

Two weeks ago the CartoDB team spent a very intense week in Barcelona, participating in the Mobile World Congress and 4YFN events at two different booths. We are certainly blessed to have such a conference take place so close to our Madrid offices, with so many relevant enterprise actors from all over the world passing through.

It is quite surprising that considering how important location-based services have become for the mobile industry, geolocation and geo-trends weren’t the main focus of the event. Most of the discussions at MWC still centered around devices and brand new product launches, while mapping companies had a somewhat contained presence.

We tried to shake things up a bit, organizing a lively panel with the CEOs of Mapbox Eric Gundersen, Mapillary Jan Erik Solem, VP Product of Factual Tyler Bell and our very own CEO, Javier de la Torre. We had a small but truly engaged audience and discussed some of the most relevant challenges facing our industry.

Is there life beyond Google?

All the mapping companies that presented have services that rival or coexist with Google location-based services and products. And it is surely hard to compete with one of the industry’s largest players, but collaborative approaches both in data collection and code development are closing the gap between those billions of dollars of investment and the effort of talented individuals teaming up to innovate rapidly.

Google’s recent efforts to focus on their location-based service APIs and end consumers will surely impact business decisions for many corporations looking for new platforms in 2015.

Where is data coming from?

The holy grail of many enterprise mapping needs starts with access to clean, curated, and relevant data, which can bring context to an analysis or story that our users want to share.

New data services are proliferating, giving people access to social media interactions, satellite imagery, and open data demographics, and enabling seamless and faster access to data sources; our companies and end customers/users are certainly benefiting from this.

In the seventies Waldo Tobler said, “Everything is related to everything else, but near things are more related than distant things.” By giving context to enterprise data and allowing the analysis of trends under a location prism, new generation mapping platforms are putting a powerful tool in the hands of business professionals who were not necessarily mappers before.

Big data, the internet of things, and maps.

Trillions of interactions collected on social media networks and millions of sensors connected to the Internet generate an increasing wealth of data being measured and stored every second. Luckily, most of this information is location-aware, allowing mapping platforms to provide context and ease the understanding of this data.

This week we announced our collaboration with Telefonica to connect their IoT/Smartcities platform to CartoDB under NGIS FIWARE standards. By supporting these standards, and thanks to the integration, specific solutions can be built by a whole ecosystem of developers to help cities to act on their data and share this with their citizens.

Uber and deCarta—what is this about?

The geo crew at MWC was abuzz with the news of the first Uber acquisition ever. Uber moving into location-based services is certainly a big deal, considering their close relationship with Google. But if we consider how core, actually, location services are for Uber’s business model—in terms of route planning, driver management, overall efficiency of daily operations—it certainly makes tons of sense for them to stay as independent from Google as possible.

What will this mean for the industry? Is Uber’s acquisition appetite complete with the deCarta acquisition? Was Uber mostly looking to amplify its data-gathering capabilities and display tools or is there more to its strategic planning? And more important, what does this mean for other big players that rely on third-party location services? Will Facebook, Twitter et al. try to build their own capabilities or work more closely with the new industry actors that enable a more comprehensive (and cost-effective, may I add) access to LBS and analysis tools.

Among the incumbents, ESRI is acting fast to position itself as the most viable enterprise-y alternative, but as we noted during MWC, the future is all about the cloud, web, and mobile, and big challenges lie ahead of this transition for legacy-heavy corporations. TomTom will now have to find a new strategic LBS partner and Nokia’s HERE is launching new products to leverage on their wealth of location-based data.

Mobile mapping

We had more requests for information than ever before about the use of CartoDB as a mapping platform to power mobile apps. And it was very motivating to see firsthand the new cool apps for business intelligence, real estate, and social media analysis being created on top of CartoDB by our community.

Mobile is a crucial part of the mapping experience, and we are working hard to empower developers with more tools to easily integrate our mapping capabilities into their apps and also rethink how maps will be consumed on smaller screens.

Kudos to our team for a great performance, and many thanks to the vibrant mapping community in Barcelona for organizing such an insightful and fun GeoBeers.

Happy mapping!


CartoDB embeds brought to you by Embedly

$
0
0

Embedly

Have you ever wrestled with iframes in responsive websites? What about resizing them after the page is loaded? Or maybe your site relies on consistently themed embeds from multiple services? If any of those or any other challenges of using map embeds on your platform sound challenging to you, look no further - CartoDB is now a supported Embedly endpoint.

What is Embedly?

Embedly is a service for embedding rich media in your website with a simple API. It wraps up a lot of the unpredictability across platforms (e.g. dimensions, URL endpoints etc.) in a simple-to-use Javascript library that makes the content integration easy.

Why use Embedly?

If you are using our normal embeds, nothing has changed, you can still use them! Embedly is an alternative if you want some cool added functionality.

Embedly is really focused on making content integration on your site consistent. It integrates CartoDB through a supported API and makes it so that no matter what CartoDB URL you share, it will give you back the correctly formatted embed map for your site. This makes it really useful if CartoDB isn’t the only content provider you are embedding on your site. Take a look at how it works over here.

Responsiveness

Embedly also handles responsive embeds really nicely. If this has ever been a problem on your website, take a look at this demo, just paste in the URL of spencer the cat to see how it works with CartoDB.

Embedly

Cards

Another interesting service that Embedly offers is the ability to generate beautiful and consistent content Cards for your website. CartoDB is also supported in the Embedly Cards service.

Much more

There are a ton of other things that the Embedly API and Javascript library can do, head over to their documentation to learn more. Hopefully this helps you out in your mapping adventures!

Building Community with Member Benefits

$
0
0

Fresh from a series of March conferences including FOSS4G, Tapestry, and NICAR, the community team at CartoDB has been working to better support our geo-journalists with new curriculum and partnerships with professional orgs like IRE. Read on for all related geo-news!

New Member Benefits

Each year, Investigative Reporters and Editors (IRE) hosts a conference to bring together journalists and technologists working in newsrooms globally. At this year’s NICAR 2015 in Atlanta, we were proud to release a bunch of upgrades to support journalists with better and more flexible maps! Among other awesome benefits, IRE now provides members with 100MB of additional CartoDB space, access to private and sync tables as well as a 30% discount on account upgrades for CartoDB. Interested IRE members should email cartodb@ire.org with the subject line: “CartoDB upgrade,” to qualify and start benefiting from these bonuses!

Conference Updates

For more on what we were up to at recent conferences, checkout the following talk materials and notes from our attending developers and community advocates:

CartoDB in Atlanta, GA

Growing Education, Growing Geo-News

This is a great time to check-in with our ever-growing library of tutorials and academy lessons: index how we are building educational materials around new features and services, and weigh-in on what we might be missing. You can look forward to our soon-to-be-announced conference, gathering together geo-journalists accross the Americas (save the date for May 15-16th). Stay tuned as well for more pairings with other organizations building cool curriculum on the web, and future partnerships with professional groups supporting our community.

Meantime, happy mapping!

World Water Day: Mapping the spread of dams in the US

$
0
0

World Water Day was celebrated this past Sunday bringing attention to issues around water and sustainable development. Given current water use, the UN predicts the world will face a 40% shortfall in water by 2030. Recent news on California’s on-going drought, and the environmental risk posed by hundreds of dams in the US highlight the importance of water in our lives.

Much of American history, both geological and cultural, is linked to the rivers of the nation. Dams, as barriers to river flow, fit into the fabric of that narrative. There are over 80,000 dams in the US, many of them built in the early 1900s. The following map animates the construction of more than 7,000 major dams using data provided by the U.S. Geological Survey.

Impact: Energy and Environmental Factors

Around the world, hydropower generates 16% of global electricity production. In the next two years, 3,700 major dams are expected to come online, doubling the total electricity capacity of hydropower.

While hydropower can be a source of economic development, dams can also pose significant risk to the environment. Just this past week, environmental organizations including the Sierra Club published a letter to the Environmental Protection Agency on their concerns regarding the hazard risk of 900 mining dams in the United States.

Strategy: Placement and Propagation

Though the history of dams in the US has mainly involved the construction of dams, more than 200 dams have been removed since 2006. The largest dam removal project in the world was completed last August on a remote stretch of the Elwha River in Washington State, part of a growing realization that not all dams built in the US are still necessary.

Who gives a Dam?

Dams and the water flow rates they manage translate into pretty powerful political capital. The success and strategic location of dam programs control the flow of water into a landscape, influencing and propagating floods, contributing to ecological devastation, and impacting the sustanence of fish and plant species, all of which grossly affect taxepayer subsidy payments.

At the same time, water policy suffers from non-standard auditing and regulation across states. Environmental and economic disasters predicated on mismanaged dams remain a fairly persistant part of domestic policy issues. Dam safety ratings, inspection plans, affliliated hazardous conditions and the overall cost of repairs and maintenance have been the topic of several news publications and FOIA requests in the domestic U.S.

The following map uses data from the National Inventory of Dams database maintained by the U.S. Army Corps of Engineers through the year 2005 (after which continued updates were promised on a two-year basis). The data provides information about the location, name, affected rivers, towns/cities in range, material composition, purpose and structural integrity of dams in the U.S. The map below color-codes the dams by their “hazard potential,” where:

  • “low” implies non-significant risk to the environment or third parties, only to the dam owner
  • “significant” implies environmental, lifeline and economic risk; typical for rural dams
  • “high” implies human life loss in addition to the risks implied in a “significant” risk scenario

If you’re further interested in the environmental impact of dam security on wildlife apart from humans, the Fish Passage Data Archive provides data on fish counts around dams. Read on for additional dam resources, and look out for our upcoming post on building narratives about rivers with Odyssey.js!

Data Sources on Dams in the US

Happy mapping!

Serving raster tiles from Google Cloud Storage to CartoDB

$
0
0

With Google Maps Engine (GME) closing down next year, GME users are looking for alternatives. CartoDB offers a great solution for mapping vector data, but some users also have raster imagery they use in maps. For those users, here’s a reliable and simple way to keep hosting imagery in the Google cloud after GME shuts down.

In brief, the steps are:

  • download the source imagery from Google (or pull out the original imagery from the desk drawer);
  • chop the raw imagery into web map tiles;
  • upload the tiles to Google cloud storage; and finally,
  • configure your CartoDB visualizations to use your tiles in the Google cloud.

Get Raster Data

From Google Maps Engine

If you have existing raster data already loaded in Google Maps Engine (GME), you can download the original files and reprocess them using our technique. Log into your GME account, and navigate to your raster data source. There is a “Download original files” link in the details page of each raster data source in GME.

Download from GME

Once you have downloaded the original data, you are ready to start creating a tile cache.

Sample Data

To just follow along with this tutorial, download a sample image file, from an open data site. The City of Kamloops has an accessible collection, for example.

Generate a Tile Cache

To generate a tile cache, we will use the gdal2tiles.py program, which comes with the GDAL image processing library. You can get gdal2tiles.py for your platform by:

Once you have the program installed, generating a tile cache is a one-line command:

gdal2tiles.py <your_input_file> <your_tiles_directory>

So for example:

gdal2tiles.py 5255C.tif kamloops

Faster, Flexible Tiles

The gdal2tiles.py program is pretty good, but it has a couple shortcomings for bulk tile creation:

  • it runs “single-threaded” so it cannot take advantage of multi-core CPUs; and,
  • it outputs PNG tiles only, which results in very poor image compression for aerial/satellite imagery.

There is an enhanced version, gdal2tilesp.py that fixes both limitations. Once you have installed GDAL as described above, you should be able to just download gdal2tilesp.py and copy it next to the original version to access the new functionality.

Running gdal2tilesp.py on 4 CPUs and outputting JPEG tiles (which makes sense for imagery) looks like this:

gdal2tilesp.py --format=JPEG --processes=4 5255C.tif kamloops

The parallel process is faster than the single process, and more importantly the JPEG storage is much smaller than PNG storage for imagery.

Upload the Tile Cache

The first time you upload to Google Cloud Storage, you will need to do a bit of setup:

  1. Create a new Google Cloud Platform “project”.
  2. Install the Google Cloud SDK, which has tools for uploading data to Google Cloud Storage.
  3. Authorize Google Cloud SDK to access your Google Account, by running the following command:

     gcloud auth login --project YOUR_PROJECT
    

Now you are ready to upload the tile cache.

  1. Create a new bucket in Google Cloud Storage to hold your tile cache. Note that when you upload data to your bucket, you will incur some costs. You can estimate the charges using the calculator provided by Google. For a small cache (1-2 Gb) the charges are only pennies a month.
  2. Navigate to your tile cache directory and run the upload command, which will recursively copy all the tiles up into the cloud. Note that you will need both your project name and bucket name to run the command.

     gsutil -m \
       -h 'Cache-Control:public,max-age:31536000,x-goog-project-id:YOUR_PROJECT' \
       cp -a public-read -R ./YOUR_TILES_DIR gs://YOUR_BUCKET/*
    

Use the Tiles as a CartoDB Base Map

Now that the tiles are stored in the cloud, you can easily add them to our CartoDB maps as a new basemap.

  1. Open up a visualization and click the “Change basemap” option at the lower left.
  2. Select the “Yours” option to add a custom basemap.
  3. Use the XYZ tab and enter in the URL for your tile cache. If you’ve followed the instructions above, it should be formatted like this:

     http://storage.googleapis.com/YOUR_BUCKET/YOUR_TILES_DIR/{z}/{x}/{y}.jpg
    

Here’s an example of the Kamloops aerial basemap with some zoning data overlaid on top. Crisp local imagery and great registration to the overlaid data too!

Our Own Basemap

Conclusion

Any raster input file that GDAL can read (and that is most of them) can be converted into a tiled basemap using this simple technique.

The same technique can also be used along with GDAL Virtual Raster Table driver and the gdalbuildvrt tool to convert large collections of multiple input source rasters into tile caches ready for upload into the Google Cloud. More on that in a future post.

Share your Points [and lines, and polygons...] with CartoDB on Microsoft SharePoint!

$
0
0

CartoDB + Sharepoint

To say SharePoint is a popular enterprise software platform is a bit of an understatement. Having evolved over 15 years, SharePoint is used by over three quarters of the Fortune 500 and over 100 million users in all. SharePoint is often described as a document-sharing, intranet, and business collaboration platform, but really its functions are as varied as the organizations that use it.

As CartoDB grows in popularity with companies as a fully-featured enterprise geospatial platform itself, it was only a matter of time before our users would want to combine their CartoDB maps with their Sharepoint sites. They work together splendidly, we’re pleased to say, and we have recently published a short 10 minute tutorial on how to share your visualizations through Sharepoint. Enjoy!

Introducing Andrew Thompson!

$
0
0

Andrew Thompson

Please read/sing along in the tune of the funky sounds of DJ Jazzy Jeff.

Now, this is a story all about how CartoDB teamed up with another Andrew/ Andrew with a T - and brought him to the Sales Engineering team.

CartoDB’s newly hired Andrew Thompson joined the Sales Engineering team in NYC last month. AT is fascinated by cities and town infrastructure - he studied ‘Growth and Structure of Cities.’ AT also likes board games (I present the friendly challenge of ‘longest road!’). Thompson can be found all weather bike commuting (hopefully not from Philly, where he lives, to NYC), engrossed in the travel readings of Bill Bryson, or hanging out with some Quakers in the Quaker State. If you were wondering if he knew a very fresh member of royalty that was born and raised in West Philadelphia…you’ll just have to ask him.

What is your favorite place in Philly?Reading Terminal Market - so many smells, sights, sounds, and sweet and savory tastes crammed into barely half a city block!

What are you most excited about in your new role at CartoDB? Sales Engineering is all about being that critical “bridge” between the technical side and the business side. I’m interested in how people and organizations make use of technologies like CartoDB to get things done and make a positive impact on the world. I’m super excited to explore the variety of geospatial problems our prospective clients have, show them all that’s possible with CartoDB, and work with our sales team to turn them into enthusiastic customers!

I’ve also been working with maps, open source, and civic tech for years and couldn’t be happier that CartoDB is right in the heart of those communities.

You majored in the Growth and Structure of Cities? What is that all about? The program has elements of urban studies, planning, and architecture, but also has a variety of classes in the social sciences. I had always been interested in geography and the built environment but didn’t fully realize that before I took my first Cities class - then I was hooked!

What is your favorite kind of tree? At my previous job at Azavea working with OpenTreeMap I actually thought about trees a lot! Oaks and acorns remind me of growing up in the woods in Massachusetts, but my favorite now around Philly is probably the London Planetree.

What is your favorite color? Red. It’s bright and colorful and stands out. Reminds me of tomatoes and lobster and sports cars.

What is your favorite state or country shape? Massachusetts! It’s where I grew up, and the shape is very distinctive with Cape Cod and the islands but also the long rectangle going back — even the tiny nib jutting out into Connecticut that was probably some farmer’s pasture in 1700. The shape reminds me of a lobster claw, which is fitting too.

What is your spirit object or animal? Geese. They swim, they fly thousands of miles, and they do well in cold weather. Sounds great to me! Honk!

Quick — Open Data: yes or no? Heck yeah! Philly practically invented municipal open data— especially GIS data, years before “open data” became a hot phrase.

Welcome, Andrew T.!

Magical PostGIS in three brief movements & CartoDBeers

$
0
0

Next Wednesday, April 15th, we’re hosting a new edition of CartoDBeers - the informal gathering where we talk about maps, tech, and latest news. This time we are proud to welcome our very own Paul Ramsey, who will be presenting ‘Magical PostGIS in three brief movements.’

Everyone knows you can query a bounding box or even spatially join tables in PostGIS, but what about more advanced magic? This short PostGIS session will look at using advanced features of PostGIS and PostgreSQL to accomplish surprising results.

Paul will be sharing his knowledge and experiences followed by a Q&A session. Following the event, stick around for a nice chat over beers. If you’re in Madrid, please join us next Wednesday from 7pm! Confirm your attendance here.

CartoDBeers will be at: Calle Eloy Gonzalo 27, 3 28010 Madrid

See you there & Happy Mapping!


CartoDB nominated for the 2015 Webby Awards

$
0
0

CartoDB is very honored to announce that we’ve been nominated for a Webby! How do you say thank you in five words or less?

CartoDB + Webby Awards

The Webby Awards are kind of a big deal - last year they received 12,000 entries from all 50 states and over 60 countries. They are known for setting the tone in Web-oriented pop culture, among other things. Declaring the selfie as officially passé and Between Two Ferns as Interwebs gold. More than that, in the spirit of the open Web, it allows the public to set the trend for what is hot on the Internet and in technology.

Out of millions of sites, videos, mobile apps in existence, and the tens of thousands that were submitted, there are only a handful of Nominees that were selected by the Academy for the 19th Annual Webby Awards. Sharing the space with four other formidable websites, we’ve been selected as one of the best in the Web Services and Applications category.

Our diligence as a creative, functional, and exceptional geospatial service has led the thousand plus judges to nominate us but it is up to you to let the rest of the world know how awesome we are.

What we need from you is to VOTE! You have already demonstrated that CartoDB is where it’s at in innovative technology. Now it’s time to get the rest of the world on board. Voting ends April 23 at 11:59PST.

Thanks and Happy Mapping!

Map of the Week: Mexico's Mississippi

$
0
0

In the wake of World Water Day (water puns for the win!), we’re plotting this Map of the Week using CartoDB + OdysseyJS to characterize rivers, and chapterize learning about location via Mexico’s Mississippi: Rios Lerma y Santiago. Read on for more about this rad approach to our understanding of environment, Latin America, and running a river through episodic narrative!

Intro

Chris Reed is a CartoDB collaborator, and long-time friend of open mapping. He’s from Houston, TX, which is home to some 27 Super Fund sites and myriad wampy juxtapositions of nature and industry. Regarding rivers, he developed a website for the Van Alen Institute’s Lower Mississippi River Delta design competition Changing Course, which in part inspired the Odyssey.js work to follow. We welcome him in this guest Map of the Week post to let him tell us about how he is using CartoDB to learn about river context and watershed wisdom.

River Basins

Inspiration

“Know your watershed,” a wise friend once quipped to me. While I agree with the intention, that’s much easier said than done.

I was reading the catalog for this year’s Enivronmental Film Festival in Washington D.C. and saw a blurb for a documentary about the Santiago River in Mexico. Curious to learn more, I watched the trailer and did a little research. Studies, stories and descriptions from up and down the river hadn’t been comprehensively synthesized anywhere that I could find. I figured this river might be a good subject for me to try out Odyssey.js and, who knows, maybe this gringo might help raise some awareness of a pretty severe environmental situation.

Implementation

As you likely well know, most rivers have many sources. But as far as I understand, the Santiago is quite linear, albeit not straight, so I was able to organize the narrative into consecutive steps from Almoloya to the Pacific. Though I am quick to do all sorts of back-end and front-end development, I focused on shaping and focusing the narrative as well as providing links and context. Tech-wise, I realized that by minimizing changes in zoom between the slides, I could ensure continuous animated transitions.

For this map, a layer to highlight the river and its basin would focus the visuals as would adding more markers to some of the slides. For Odyssey.js, a plugin for sourcing and embedding media with latitude and longitude via API integrations would be very cool especially in the context of a publishing platform that integrated a crowd-sourcing workflow. Imagine if a watershed organization could source and situate media from across their community through services like Flickr, Soundcloud, etc.

Santiago River

References

If you’re interested in reading more on the Santiago River Basin see the Santiago Odyssey project website. Chris also once helped build an interactive map of NYC street trees with CartoDB’s Andrew Hill and a few other very talented people at a DataKind event. In 2013, he started a digital studio called SEEREAD.info where he works all sorts of interactive magic, and you can reach out to him there!

Here are some other references to inform this post and its topic:

Outro

Try CartoDB today to create amazing map narratives like this with your data; check out our past Maps of the Week, and all our awesome docs related to Odyssey.js to build your knowledge of our narrative library!

Thanks so much to Chris for his awesome post, and all best for your future odysseys in JavaScript!

Happy Mapping!

Map moving objects with CartoDB and Firebase

$
0
0

Real time

Firebase is an awesome platform for making real-time applications, allowing developers to push and receive updates from multiple clients easily. When data changes, apps built with Firebase update instantly across every device – web or mobile.

And CartoDB is an awesome platform for designers and developers to create beautiful maps and apps easily. When data changes, CartoDB maps update to keep in synch with reality.

So, what better combination to produce maps of real-time data, than Firebase and CartoDB?

Firebase

We’ve contributed a guest post at the Firebase blog (and a demonstration application) about using CartoDB and Firebase together, check it out!

OGC Web Map Server support in CartoDB

$
0
0

WMS! What, more stuff? We make software, with map standards: Web Map Server. That is to say, CartoDB now offers the possibility of making its visualizations viewable via the Open Geospatial Consortium (OGC) Web Map Server (WMS) and Web Map Tile Service (WMTS) standards. The newest, hippest maps on the web just got “old school”.

Open Geospatial Consortium

CartoDB maps are available in a number of ways: through shared links, with embeds, using the CartoDB.js library, and via the Maps API. But there is a lot of software in use that pre-dates CartoDB, and by adding support for WMS/WMTS to CartoDB, we’ve opened up our maps to that software too.

This functionality comes with our Enterprise offering, if you want it activated please contact us.

So now you can add a CartoDB layer to your ArcGIS project.

ArcGIS showing CartoDB

Or to your QGIS project. (Actually, there is also a QGIS plug-in for CartoDB that is even more full-featured.)

QGIS showing CartoDB

Or to any other mapping software that supports WMS.

This could be of particular interest for data publishers that need to comply with OGC standards when publishing data, like for example in Europe with the INSPIRE initiative.

Finally, for those users coming to CartoDB from Google Maps Engine this could be a very important addition to have a successful migration.

How it Works

Once the add-on is activated on your account, just use the standard WMS end point for your account (where “user” is your account name) and plug it into your software:

http://user.cartodb.com/api/v1/wms

For WMTS connections, use the WMTS capabilites URL:

http://user.cartodb.com/api/v1/wmts/1.0.0/WMTSCapabilities.xml 

Or, if you are building WMS requests by hand, send them to the end point as usual. For example, for a listing of available layers, use a GetCapabilities request:

http://user.cartodb.com/api/v1/wms?Version=1.1.1&Request=GetCapabilities

Or for a map rendering of a layer, use a GetMap request:

http://user.cartodb.com/api/v1/wms?Version=1.1.1&Request=GetMap&Layers=layername&Styles=&SRS=EPSG:4326&BBOX=-180,-85.05,180,85.05&Width=400&Height=200&Format=image/png

The WMS support for CartoDB has a few limitations that are important to keep in mind, for example:

  • Spatial reference systems supported are only ESPG:4326 (geographic) and EPSG:3857 (Web Mercator).
  • Compositing by requesting multiple layers in one GetMap request will not work. Each request can only address one layer at a time.
  • Rendering is carried out by merging tiles from the CartoDB tile cache, which can result in some odd effects, particularly in EPSG:4326 where labels and symbols may appear slightly squashed, especially at higher latitudes.

CartoDB & Maptime: Let There Be Pizza!

$
0
0

At CartoDB we love our mapping communities. With Maptime being one of our favorite gatherings - and a catalyzer of mapping culture not only in CartoDB’s home of New York City, but across the world - We felt it was time to give a big pizza slice shaped thank you to all the map-building, pizza-loving folks that have elevated Maptime as a staple in cartographic culture.

CartoDB + Maptime

For the entire month of March, CartoDB had the honor of buying pizza for an entire globe of Maptime mappers from Los Angeles, to our Maptime hosted in CartoDB’s own New York City office, and many places in between (no matter which way you travel). Needless to say, the CartoDB sponsored, pizza-fueled March of Maptime was a huge success. Rejoice!

It was a real treat to give back to the friends and colleagues that have made such a vibrant mapping community a reality. Our team here at CartoDB loves to learn, teach, and help spread the love we share for mapping and data visualization with everyone. Speaking of which, here’s an interesting MaptimeSheds map made by Maptimer Keith Jenkins that shows just how may different Maptimes we aimed to support with cheesey goodness.

We’re always looking for ways to elevate our fellow mappers in creative ways. Stay in contact, Share your maps, and stay tuned for more ways we’re co-creating a culture of mapping!

Thanks and Happy Mapping!

Maptime

Viewing all 820 articles
Browse latest View live