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

2015: The Year of Pizza!

$
0
0

pizza

Supporting our mapping communities around the world is a big slice of what CartoDB is all about. We feel that it’s our fellow mappers and GIS communities that have helped shape what CartoDB is today. This is why a few months back CartoDB had the pleasure of buying pizza for a world of mappers for our March of Maptime! The pizza was a hit, and we had a blast, so we asked ourselves: “Why stop there?”.

As everyone knows, pizza and mapping go hand in hand. We enjoyed feeding and supporting our Maptime community so much that we couldn’t help but keep the pizza love coming. With so many great mapping events this week, from the largest State of The Map Conference to date this past weekend, to the first ever Maptime Summit today, we felt this was the perfect time to announce that CartoDB will be buying pizza for a world of Maptime Meetup mappers. This time for a whole year!

Today’s Maptime Summit kicks off CartoDB’s 2015: The Year of Pizza, where we will be providing pizza for Maptime Meetups everywhere for a whole year! It’s the least we can do to elevate our fellow mappers and work together to build a vibrant culture of mapping.

Whether you’re new to mapping, or have some great projects and insight to share, be sure to join one of the many Maptime Meetups in cities across the world. Grab a slice on us, make some great friends, share some great maps and remember - CartoDB <3 You!

Happy Mapping!


Map of the Week: Making Rent

$
0
0

Property values are a persistent obsession for New Yorkers, as are the arbitrary constraints to dwelling well (dwelling? yes). Between navigating the rental quagmire of online listings to toggling the various Trulia, StreetEasy, and Zillow helper services, you can tumble down a rabbit hole of the worst options imaginable (or at least, publishable). In the bizzare world of renting, we can help you through the looking glass.

This Map of the Week features the work of a familiar face to CartoDB, Chris Henrick, who between juggling GIS projects and grad school also co-organizes Maptime NYC. His MFA thesis project “Am I Rent Stabilized?” combines code, maps, and critical thinking about urban planning and renters rights - all of which we love and welcome at CartoDB! He currently lives in Brooklyn, NY, where we locals join him in an obsession with rent rates and regulations. Read on to discover more of the mechanics behind his impressive web app!

Am I Rent Stabilized? is a web application that encourages New York City tenants to find out if their landlord may be illegally overcharging them for a rent stabilized apartment and if so, motivates them to take action. The development of the app was spearheaded by the lack of enforcement of rent regulation laws in NYC by the local and state government. It is an attempt at using open data as a prompt for civic action, rather than solely for visualization and analysis. The app asks the user to input their address and borough, then checks it against a database of properties that are likely to have rent stabilized apartments. From here the app recommends a course of action and informs the user of their nearest tenants rights group so they can get help. The app features a responsive UI that is mobile friendly and its content can be toggled to either Spanish or Chinese, for non-english speakers.

Landing Page for AIRS

DHCR & MapPLUTO Data Processing

Am I Rent Stabilized? uses a database I created that lives on CartoDB, which enables the website to work as a fully funcitonal web-app using the CartoDB SQL API and CartoDB.js library. However, I did a lot of data processing on my local machine before importing the data into CartoDB.

  1. Processing the DHCR Rent Stabilized Building List

Excel workbooks obtained from a Freedom of Information Law request by the NY Department of Housing and Community Renewal were normalized, stacked, and converted to a Comma Separated Value (CSV) file format using a Node JS script. This allowed the data to be geocoded at once and then imported into a PostgreSQL database where it could be analyzed with the NYC MapPLUTO GIS tax lot data.

  1. Geocoding the Processed DHCR data

A Python script was then used to obtain values for each property’s Borough - Block - Lot number (BBL), Building Identificaiton Number (BIN), and latitude - longitude coordinates from the NYC GeoClient API. A property’s street address and borough are passed to the GeoClient API, which then returns a plethora of useful information about the property such as the BBL, BIN, latitude and logitude values.

  1. Determining NYC Properties That Are Likely Rent Stabilized

After processing and geocoding the DHCR data it was imported into a PostgreSQL database using CSVkit’s csvsql command as follows: csvsql --db:///nyc_pluto --insert dhcr_rs_geocoded.csv --table dhcr_rs

From here PostgreSQL was then used to analyze the data. Here is a link to the entire SQL code, but the most important queries are the following:

-- select the number of properties in the dhcr list the nyc map pluto data
-- returns 47,130 rows
SELECTCount(a.bbl)FROM(SELECTDISTINCTbblFROMmap_pluto2014v2)ASaINNERJOIN(SELECTDISTINCTON(bbl)bblFROMdhcr_rs_w_bblsWHEREbblISNOTNULL)ASbONa.bbl=b.bbl;-- select the number of properties in the dhcr list not in the map pluto "likely rent-stabilized" query
-- returns 12,549 rows
CREATETABLEmap_pluto2014v2_likely_rsASSELECTCOUNT(a.bbl)FROM(SELECTDISTINCTbblFROMmap_pluto2014v2WHEREyearbuilt<1974ANDunitsres>=6AND(ownernameNOTILIKE'new york city housing authority'orownernameNOTILIKE'nycha')ANDbldgclASsNOTILIKE'r%')ASaLEFTJOIN(SELECTDISTINCTbblFROMdhcr_rs_w_bblsWHEREbblISNOTNULL)ASbONa.bbl=b.bblWHEREb.bblISNULL;
You Might Be Rent-Stabilized

These two queries tell us: A. what properties in the MapPLUTO tax lot data match the DHCR’s rent-stabilized building list, and B. what other properties are likely to have rent-stabilized apartments but aren’t on the DHCR list. From here I created a table that combines data from both queries as well as a flag that states whether or not the property is listed in the DHCR data.

CREATETABLEmap_pluto_not_dhcrASSELECTnot_dhcr.address,not_dhcr.unitsres,not_dhcr.borough,not_dhcr.ownername,not_dhcr.zipcode,not_dhcr.yearbuilt,not_dhcr.geom,not_dhcr.cd,not_dhcr.council,not_dhcr.bbl::bigintFROM(SELECTa.*FROM(SELECT*FROMmap_pluto2014v2WHEREyearbuilt<1974ANDunitsres>=6AND(ownernamenotILIKE'new york city housing authority'orownernamenotILIKE'nycha')ANDbldgclassnotILIKE'r%')ASaLEFTJOIN(SELECT*FROMdhcr_rs_w_bblsWHEREbblISNOTNULL)ASbONa.bbl=b.bblWHEREb.bblISNULL)ASnot_dhcr;CREATETABLEmap_pluto_dhcr_rsASSELECTdhcr.address,dhcr.unitsres,dhcr.borough,dhcr.ownername,dhcr.zipcode,dhcr.yearbuilt,dhcr.geom,dhcr.cd,dhcr.council,dhcr.bbl::bigintFROM(SELECTc.address,c.unitsres,c.borough,c.ownername,c.zipcode,c.yearbuilt,c.bbl,c.cd,c.council,c.geomFROMmap_pluto2014v2c,(SELECTDISTINCTbblFROMdhcr_rs_w_bblsWHEREbblISNOTNULL)dWHEREc.bbl=d.bbl)ASdhcr;-- I then added a column to identify properties that are registered or not registered with the DHCR:
ALTERTABLEmap_pluto_not_dhcraddcolumnregisteredboolean;UPDATEmap_pluto_not_dhcrsetregistered=false;ALTERTABLEmap_pluto_dhcr_rsaddcolumnregisteredboolean;UPDATEmap_pluto_dhcr_rssetregistered=true;-- now these two tables can be combined AND have a boolean value for whether or not they are in the DHCR's rent-stabilized buildings list.
-- 59,679 rows total.
DROPTABLEmap_pluto2014v2_likely_rs;CREATETABLEmap_pluto_likely_rsASSELECT*FROMmap_pluto_not_dhcrUNIONSELECT*FROMmap_pluto_dhcr_rs;-- check to make sure the data looks good:
SELECTCount(*)FROMmap_pluto_likely_rsWHEREregisteredISNULL;-- returns 0 rows
SELECTCount(DISTINCTbbl)FROMmap_pluto_likely_rs;-- returns 59,679 rows
SELECTCount(*)FROMmap_pluto_likely_rsWHEREgeomISNULL;-- returns 0 rows
SELECTSum(unitsres)AStotal_res_unitsFROMmap_pluto_likely_rs;--returns1,962,469
  1. Further Data Processing Using CartoDB Lastly, the data was imported into CartoDB and some final tweaks to the data were made.
--  Remove all properties owned by the NYC Housing Authority that were missed.
--  This involved doing a spatial intersect with polygon centroids created from
-- a shapefile of NYCHA properties from 2011 to determine all spellings of "NYCHA"SELECTDISTINCTa.ownernameFROMmap_pluto_likely_rsa,nycha_centroidsbwhereST_Intersects(a.the_geom,b.the_geom)ORDERBYownername-- remove properties that are obviously owned by NYCHA
DELETEFROMmap_pluto_likely_rsWHEREownernameLIKE'NYC HOUSING%';DELETEFROMmap_pluto_likely_rsWHEREownernameILIKE'new york city%';DELETEFROMmap_pluto_likely_rsWHEREownernameLIKE'NYC CITY HSG%';DELETEFROMmap_pluto_likely_rsWHEREownername='CITY OF NEW YORK';DELETEFROMmap_pluto_likely_rsWHEREownernameLIKE'N Y C H A%';DELETEFROMmap_pluto_likely_rsWHEREownernameLIKE'N.Y.C. HOUSING AUTHOR%';DELETEFROMmap_pluto_likely_rsWHEREownernameLIKE'N Y C HOUSING AUTHORI%';DELETEFROMmap_pluto_likely_rsWHEREownername='NY HOUSING AUTHORITY';DELETEFROMmap_pluto_likely_rsWHEREownername='NEW YRK CTY HSG AUTHR';-- pgsql2shp converted boolean value of the "registered" column to T / F,
-- so I changed the valuse to 'yes' / 'no' for CartoDB Infowindows
UPDATEmap_pluto_likely_rssetregistered='no'WHEREregistered='F';UPDATEmap_pluto_likely_rssetregistered='yes'WHEREregistered='T';-- change boro codes to actual names for CartoDB Infowindows
UPDATEmap_pluto_likely_rssetborough='Queens'WHEREborough='QN';UPDATEmap_pluto_likely_rssetborough='Brooklyn'WHEREborough='BK';UPDATEmap_pluto_likely_rssetborough='Staten Island'WHEREborough='SI';UPDATEmap_pluto_likely_rssetborough='Bronx'WHEREborough='BX';UPDATEmap_pluto_likely_rssetborough='Manhattan'WHEREborough='MN';

Creating Catchment Area Polygons For Local Tenants Rights Organizations

In order to inform a user as to whether or not any local tenants rights organizations are operating within their neighborhood, custom polygon geospatial data was created to respresent each of the 94 organization’s service areas.

Landing Page for AIRS

First, a list of Community Based Housing Organizations was scraped from an HTML table on the DHCR’s website using a Python script. Organizations that operate in the boroughs / counties that make up NYC were pulled out from the scraped data into a new table.

For these 94 organizations, polygon data was manually created representing each organization’s service area. Reference polygon geospatial data sources used to create the service areas include Pediatcities NYC Neighborhood boundaries, NYC Planning Neighborhood Tabulation Areas, U.S. Census Zipcode Tabulation Areas, and NYC Planning Community District boundaries. This data was copied and in some cases aggregated (dissolved) into a new dataset using MAPublisher, a GIS plug-in for Adobe Illustrator. In some cases boundaries had to be drawn by hand, such as for the Cooper Square Committee, which operates within a very specific area in the East Village of Manhattan. Once completed, the polygon data was joined to the DHCR Community Housing Based Organizations for NYC and then exported to a shapefile format.

The data was then imported into CartoDB for use with Am I Rent Stabilized. When a user’s address is geocoded, a point in polygon SQL query is made via PostGIS to the data in CartoDB.

For example:

SELECT*FROMnyc_tenants_rights_service_areasWHEREST_Contains(nyc_tenants_rights_service_areas.the_geom,ST_GeomFromText('Point(-73.917104 40.694827)',4326));

If a user’s address is within a group’s cachment area, that group’s information is passed into a modal in the app that displays information such as the group’s website url, phone number, contact person, and/or address. As this data varies from group to group, a Handlebars.js helper function is used to check if the data exists before passing it to the Handlebars HTML template.

varH=Handlebars;H.registerHelper('each',function(context,options){varret="";for(vari=0,j=context.length;i<j;i++){ret=ret+options.fn(context[i]);}returnret;});H.registerHelper('if',function(conditional,options){if(conditional){returnoptions.fn(this);}else{returnoptions.inverse(this);}});
Likely Rent Stabilized Map

Learn More!

Interested in learning more about the project? Tweet Chris (@chrishenrick) your thoughts and questions, check out the links below, and review his cross-posting on Urban Omnibus!

Thanks for reading, and happy renting!

SOTMUS 2015 x CartoDB!

$
0
0

Just over the East River, from our Brooklyn office, State of the Map US 2015 kicked off at the United Nations headquarters with a weekend packed full of mapping oriented talks, activities, and events. We at CartoDB were excited to take part and engage with a community filled with innovative thinkers - bringing the world up-to-date at the biggest Open Street Map conference. All of the energy of the mapping world converged in one space to make a great and invigorating affair.

Awesome mappers from CartoDB - Aurelia, Hayley, and Santiago - could be spotted helping make SOTMUS run smooth. You probably saw them navigating you in the right direction between talks or on your way to lunch.

Volunteers

Javier captured an awesome photo of mappers doing what they do best (having fun!) using DigitalGlobe’s awesome high-resolution satellite image. This shot was taken just before lunch on Sunday. A group assembled on the blue circle and if you look closely enough, you can see members of the CartoDB team and 40 other magnificent mappers including Alex Barth, Jessie Braden, and Seth Fitzsimmons.

SOTM_ONE

We sent our love, which happens to come in the form of cheesy, tomato sauce goodness to Maptime. This global movement of mapmakers and geo-learners is one of CartoDB’s favorite trends since Capybara vs. LoL Cat. We kicked off our continued support of this group with a pizza lunch, hosted by friends at NYU’s ITP, at the Global Maptime Summit.

Maptime

The festivities are officially over. :( Now we go back to our regular day jobs, which aren’t so bad when you are working with the mapping community, taking pictures from satellites, or eating pizza! Until next time, catch us on Twitter or visit our offices to say, “Hi.”

Advanced Mapping with the GDELT API + BigQuery

$
0
0

In the second addition of our series on clever mapping with GDELT data (see this post from last week), we wanted to take on some more advanced mapping techniques. Again, we welcome Kalev H. Leetaru of the GDELT Project to explain how using geospatial information about journalism can build a better understanding of media in our world! Read on for more!

Customized Data Feeds via the GDELT API

While the Geographic News Search tool we explored last time is great, it can also be limiting. You can’t customize the look-and-feel. The clickable layer only displays the last hour of news coverage and you can only display one query at a time. That’s where the GDELT API comes into play!

We’ve created a powerful new API that lets you take your query and get back a GeoJSON stream of matching coverage, exposed as a normal HTTP URL that you can paste into CartoDB and import as a new table! If your CartoDB account has “sync tables” enabled (John Snow or greater and all education accounts), then just click on “sync every hour” when you create your new table and CartoDB will automatically download the latest updates from the API every hour and refresh your table. You get a live-updating map automagically!

Using the API, you can create as many customized GDELT feeds as you want, focusing on people, organizations, GDELT Themes, news outlets, languages, or any combination therein. Each feed becomes its own CartoDB table, ready for you to make rich interactive maps!

We’ve laid out a step-by-step tutorial that walks you through every mouse click needed to use the API and create a new clickable and animated map from GDELT! In just 5-10 minutes you can have your first map ready!

The map below, which the tutorial walks you through creating, shows global coverage of major kinds of unrest - from military attacks to stonethrowing, covering the last 24 hours. Check out the tutorial now!

If you’re feeling particularly adventurous, read up on the full documentation for the GDELT API, especially the section on the “GCAMVAR” – this allows you to include any of the thousands of emotions that GDELT assesses from each article using the GDELT Global Content Analysis Measures system, which applies 24 of the major sentiment analysis packages! Imagine the possibilities in creating breathtakingly detailed real time maps of global emotions!

Advanced GDELT Mapping Using Google BigQuery

For those comfortable writing SQL, Google houses a copy of GDELT in its BigQuery database platform that you can use to create some truly awesome maps that span multiple months or involve extremely complex queries. Just sign up for a Google Big Query account and start experimenting!

Plot Media Output

For inspiration, the heatmap below was created by Felipe Hoffa, Developer Advocate on big data at Google, meant to visualize a day in the life of the global news media via GDELT using Google BigQuery and CartoDB. The map plots all worldwide locations mentioned in a single day of global news coverage monitored by GDELT, using the copy of GDELT linked above.

In his Reddit post, Felipe walks through the process he used to create the map, including his BigQuery SQL, a re:dash interface, and the streamlined process of importing into CartoDB using the new “oneclick” interface. You’ll notice that this map closely matches global population density estimates for 2015, especially when clustering metro areas into their centroid points as GDELT does.

Compare News Sources

The gif below shows another map built using BigQuery – this time comparing the geographic coverage of the BBC (orange) and New York Times (green) over the month of March 2015 in 15 minute increments and rendered using Torque. To learn more about how this map was made see the blog post about it or the “Mapping a Week in the Life of the World’s News Media” post that it was based on, which includes all of the source code to make this map.

BBCv.NYT

Track a Media Outlet

Likewise, the gif below shows the same approach used with the “Cumulative” option in Torque to create a cumulative map of the geographic focus of IRIN’s news coverage over the last three months, showing how with a single line of SQL, a few lines of PERL, and CartoDB, you can quite literally map the geography of a news outlet over time!

Geo of IRIN

Model Topics and Stories

With a little extra work, you can even incorporate GDELT’s Automatic Source Location Georeferencing datasets, which exist for both English and non-English news outlets, estimating their country-level geographic location. Using this data, you can map how the media of each country portray different topics!

Using the GDELT Event Database, you can combine the event and narrative datasets in GDELT to produce truly incredible visuals of the world’s activity and discourse. Featured as the CartoDB Map of the Week for August 18, 2014 and supported by the US Institute of Peace, the GDELT Global Conflict Dashboard map below shows a cross-section of global protests and conflicts. Learn more about how the map was created or download the code to make your own version using the CartoDB SQL API! Creating a map like this, especially with the live SQL API updating and use of multiple scripts and programming, to combine and filter everything means this is a non-trivial coding effort. This example provides a template for extremely sophisticated use of GDELT that blends data feeds in highly innovative ways.

Map Issues of Interest

Finally, our eco-enthusiasmisstrong at CartoDB, and we would be remiss if not to mention how GDELT can be used to study wildlife preservation issues globally. Want to learn how to track a poacher with media posts, or tease out how terrorism syncs with poaching practice globally? Check out the Wildlife Crime Report map below, learn about its making in this blogpost, and read the feature on Foreign Policy, “Can you use big data to track an elephant poacher?”.

Two other maps track the discussion around drones and cyberattacks in the popular media globally. A “making of” blogpost walks step-by-step through the creation of all three maps.

We hope all of these examples have inspired you and that you’re as excited about this new dataset as we are! Please email Kalev Leetaru at the GDELT Project if you have a map you’re particularly proud of. He might even feature it on the GDELT Blog!

Stay tuned for more on the GDELT front, and happy mapping!

CartoDB & Digital Globe Take a Selfie from Space!

$
0
0

SOTM_ONE

As you may know, last week the United Nations Headquarters in New York City hosted the monumental State of The Map US Conference, and for a few days, the CartoDB team and map lovers from around the world got together for some incredible events and happenings across the city! You may have also noticed that our team here at CartoDB in partnership with DigitalGlobe took this opportunity to take the first ever high resolution satellite selfie from space!

The opportunity to take such a monumental selfie at such a monumental conference was nothing short of amazing, and of course everyone involved wanted to know more!

With DigitalGlobe and CartoDB it is possible to bring incredibly crisp and current high resolution satellite imagery into the CartoDB editor to use with your data. All this is possible thanks to DigitalGlobe’s insanely powerful WordView-3 Satellite!

WorldView-3

WorldView-3 is the industry’s most advanced multi-payload, super-spectral, high-resolution commercial satellite. Operating at an expected altitude of 617 km, WorldView-3 provides 31 cm panchromatic resolution, 1.24 m multispectral resolution, 3.7 m short-wave infrared resolution, and 30 m CAVIS resolution.

This means that for our selfie at SOTM, each pixel was approximately 31 centimeters! Pretty impressive for an orbiting camera traveling at about 17,500 miles per hour! At the time of the selfie, the satellite was traveling near Cape Cod and Rhode Island. That’s over 100 miles east of the State of The Map Conference with an unparalleled image quality! Truly Mind Blowing!

Of course, it takes much more to bring those images back to earth and into CartoDB. With DigitalGlobe’s network of ground downlink stations near the Equator and at classified locations in Antartica, the WorldView-3 Satellite took our picture at approximately 11:43AM, was downlinked, processed by DigitalGlobe in Colorado and ready to be mapped using CartoDB as a GeoTIFF image before 5:00PM that same afternoon. Talk about break-neck speeds!

earth

The Selfie from Space was quite the experience, but here at CartoDB we are giddy just thinking of the possibilities for CartoDB users around the world to take this type of satellite imagery to the next level. Importing DigitalGlobe imagery into CartoDB is incredibly easy, and can be accomplished in just a few easy steps! You can purchase the most recent high resolution DigitalGlobe imagery directly from us for use in your CartoDB account through our Beta Program, and we’re working to release this functionality right in the CartoDB Editor soon. Interested? Drop us a line at sales@cartodb.com to get started!

Happy Mapping!!

Mapping Magic at the Eyeo Festival 2015

$
0
0

Early June was a grand month for conferences in the civic tech and mapping scene. Reviewing the online documentation for the Personal Democracy Forum, State of the Map, and the concurrent OKFN meetups reveals a healthy two weeks of activity on the USA-EST front. With so much hyper-local happening, we at CartoDB decided to stay local as a team, and outsource our distant conference attendance to a deserving academic. Two weeks ago, we tweeted asking for the “best mapping visualization in exchange for a free ticket to Eyeo,” and while there were several worthy submissions, one was superior to the rest.

Meet Kevin Dyke, our guest blogger this week. He is the Spatial Data Analyst/Curator at the John R. Borchert Map Library at the University of Minnesota, and the gracious recipient of our Eyeo Scholarship. Kevin did his graduate work in geography and GIS, has worked as a web GIS applications developer, currently spends his days wading through geospatial metadata, and has been a CartoDB user since 2011 - aka he’s obscenely qualified. Read on for his review of the best mapping projects at this year’s Eyeo Festival!

INTRO TO EYEO

For those unfamiliar, the Eyeo Festival is an annual conference for coders, artists, and technologists held at the Walker Art Center in Minneapolis, Minnesota. Already in its fifth year, the conference is famous for selling out only hours after tickets are released, and the attending population culls from a global milieu of some of the coolest and eclectic creative people building brilliance on and offline.

Eyeo Festival: Converge to Inspire

How do maps fit into this? Lots of visualizations and artists have mapping specialties at the Eyeo Festival; below are a few examples.

MAP SELECTION (a collection of Eyeo projects)

Cordon Sanitaire Mobile
  • Monroe Work Today - A work in progress on the legacy of pioneering sociologist Monroe Work, who the speaker dubbed, “the original data scientist.” The current map component is beta, and you can follow developments @MonroeWorkToday.
Monroe Work in Progress Maps
Submarine Surveillance: Cable Taps Map
NYPL Labs Building Inspector Project

You might also check out Edda, @mgiraldo’s app for drilling communication geo-tunnels to your remote friends on mobile.

Edda App Screenshots

HIGHLIGHTS (a collection of thoughts about eyeo projects)

Some of the most provocative projects were not those that involved maps alone, but those that made me pause and consider how I might think differently about maps and my work with them.

For example, Nicky Case talked about the enormous UX improvement to Parable of the Polygons that resulted from simply changing one bit of text from abstract instruction (“Move them if less than 1/3 of their neighbors are like them.”) to a reflection of an individual’s desire (“I wanna move if less than 1/3 of my neighbors are like me.”). Such a subtle difference could really have a strong effect on web map UX as well. The entirety of Case’s talk centered on the relationship between “systems” and “stories,” and the benefits of bringing elements of one into the other.

Parable of Polygons a project with OMG Vi Hart!

A couple highlights were more ephemeral. First, the excitement I felt when I walked into the NYPL Labs talk and was handed a pair of anaglyph 3-D glasses, which I later learned were for demonstrating some of their work with stereoscopy.

Stereogranimator

Second, at the start of Kawandeep Virdee’s talk, he instructed us to go to bloopdance.com on our phones, and to then shake them all around. The motion across the crowd and the resulting sound and color produced a collective kind of giddiness that was really fun to experience.

With that, we close this redux of mapping projects and hope it has inspired you to craft some demonstrative, interactive, and all-together epic maps of your own. You can reach out to Kevin via his seldom-updated-but-available Twitter @kr_dyke, and subscribe to Eyeo’s Newsletter for updates on the upcoming conference, and tips on how you can pitch your visualizations for a future talk!

Happy Mapping !

Welcome Stuart!

$
0
0

Stuart Lynn

"When people on airplanes ask me what I do, I used to say I was a physicist, which ended the discussion. I once said I was a cosmologist, but they started asking me about makeup, and the title 'astronomer' gets confused with astrologer. Now I say I make maps."

If you’re a physics buff then you might recognize the above quote as one from Margaret Geller, astrophysicist and author of Einstein-esque zingers. We’re physics buffs at CartoDB. Half of our Community Team earned its formal education in a field that studies the physical properties and phenomena of our world. This makes sense, since folks who build tools to map humanity understandably stem from a fascination with flux in the physical topography of our universe. With the addition of Stuart Lynn, our team of hackers grows to accommodate a pretty brilliant and inquisitive scientist with a background in planet tracking, climate mapping, and studying ‘spooky matter’ of galactic proportions.

Read on to get to know our newest Map Scientist at CartoDB!

From Science to Map Science

For the past five years, Stuart has been working as a developer/researcher/generalist at the Zooniverse, the largest collection of web-based citizen science research. Working with scientists who have large data volumes: millions of images of galaxies, thousands of photos from camera traps in the Serengeti or thousands of cancer cell biopsies, that are still best analyzed by people rather than algorithms, he helped develop intuitive and powerful web interfaces that allowed anyone to contribute to that analysis with nothing but a browser.

Before that, Stuart obtained a PHD in Astrophysics from Edinburgh University at the Royal Observatory in Edinburgh. There he helped to develop computer simulations of how large scale structures form in the universe and how this affects the distribution of galaxies. Wut? YESSS.

Stuart joins CartoDB as a Map Scientist. Among other programmatic work, he’ll be channeling his inquisitiveness to sync our team with scientific, museum, and social good sectors, studying how CartoDB can best impact and enhance the already amazing work done in these areas.

"I want to first understand how people derive understanding from playing with maps and then develop tools that we can layer on to accelerate and ease that process."

His background in astrophysics has trained a sensitivity to how humans process complex information through data, and he’s ever-fascinated by how visualizations, and particularly maps, can help us augment and counterbalance our intuitions, giving a clearer view of the world we live in and hopefully leading us to make better choices in that world.

"I love watching people see a map for the first time that challenges an idea they have about the world. It's really energizing to watch the journey they go through from disbelief to a new understanding. I really want to spend sometime trying to understand better how that happens and how people explore and digest that information."

Past Passion Projects

  • OldWeather - a crowdsourced effort to extract climate data from logbooks of World War I ships. Not only did the participants on that project help provide invaluable data for climate simulations but also uncovered amazing stories of the lives of sailors on these boats. Check out the resulting CartoDB viz below:
  • PlanetHunters - an ambitous attempt to discover planets around other stars. Using public data from the Kepler space telescope, thousands of citizen scientists hunted for the tell tale dips in light that indicated a planet orbiting a distant star. Over 7 planets have been discovered and published from the program so far, including the first known planet in a 4 star system! Read more about that in the Zooniverse blog!
Planet Hunters Interface
  • Journal Of Brief Ideas - a peripheral project and platform to publish and get credit for short scientific ideas. This is closely related to the OpenJournal, an attempt to produce an open platform for peer review!

Q & A

What is your favorite place?

I currently live in Chicago and my favourite place here is the Green Mill, an old Art Nouveau speakeasy bar in the north is Chicago that has fantastic Jazz and comedy and is just a fun place to hang out.

What is your spirit animal?

Not sure if it is my spirit animal exactly but I have become hugely obsessed with Cuttlefish. They are the super intelligent, shape-shifting, camouflaging, cross dressing badasses of the sea.

Any alternative career paths?

As an astrophysicist, web developer, and researcher who has spent the past few years hunting for aliens, discovering exoplanets, monitoring the Serengeti and now working on maps, I feel like my career path is pretty alternative! I am convinced that they best way to live is to change up what you do every 5 years or so. So I would say I haven’t had a career path, more like a career meander.

An app or tech thing you can’t live without?

Honestly it’s a pretty low tech piece of kit…it’s actually my bike, and it’s not even a particularly fancy bike. It’s my main mode of daily transport but more than that I feel like it connects me to the city and the rest of the world in a way driving or public transport doesn’t, and there is no problem that can’t be made to seem better by a long bike ride through the city at night.

What’s your best unprofessional talent?

I am currently learning to play the fiddle with the hope of one day getting to play and make people dance at a ceilidh.

With that, we wrap up our interview with Stuart Lynn, and happily welcome him to our team at CartoDB. He’ll be toggling between New York and Chicago for the next few months, so feel free to give him a shout stuart@cartodb.com if you want to talk about science, maps, the universe, the curious behavior of cuttlefish, or the future and theory of everything.

Meantime, happy mapping !

Geoprocessing with PostGIS - Part 1

$
0
0

CartoDB is built on top of PostGIS, the powerful add-on that turns PostgreSQL into a spatial database. Many popular Geoprocessing functions in GIS software can be done with PostGIS queries, and this blog series will provide a one-for-one replication of the functions in QGIS’ Vector>Geoprocessing Tools menu.

qgismenu

In QGIS, the Vector menu has all sorts of goodies, but we’ll focus on the Geoprocessing Tools submenu, which has Convex Hulls, Buffers, Intersects, Unions, Dissolves, and more. If you’re making maps, these are important tools for the data-munging process, and with a little SQL and PostGIS you can do them right here in CartoDB! We’ll start with two: Convex Hull and Buffer.

Convex Hull

A Convex Hull is the smallest convex polygon that can contain a set of other geometries. The process is often described as stretching out a rubber band around a set of points, which will constrict to its smallest possible shape. Why would you use a convex hull in mapping? There are a few use cases: They can be useful for highlighting patterns in data and visualizing coverage areas. This whitepaper from Azavea uses them to analyze the “compactness” of congressional districts.

Let’s start with a set of 12 random points over Brooklyn. With the points loaded in QGIS (with a nice borough boundary layer courtesy of the New York City Planning Department), running the Convex Hull wizard will generate a new shapefile with a single polygon that encompasses all 12 points. Here’s what the new convex hull looks like on the map:

qgismenu

Now let’s load the same data into CartoDB and name its table testpoints.

PostGIS has a function called ST_ConvexHull() that will generate a convex hull from a collection of geometries. However, our testpoints dataset is a bunch of individual points, so we must first collect them into a geometry collection using ST_Collect().

So, our first pass at at a convex hull SQL statement looks like:

SELECTST_ConvexHull(ST_Collect(the_geom))ASthe_geomFROMtestpoints

This will work, but remember that we must have a the_geom_webmercator field in our result set for CartoDB to render it on the map. To accomplish this, we use ST_Transform() to convert the WGS84 coordinates in the_geom to web mercator coordinates for mapping:

SELECTST_ConvexHull(ST_Collect(the_geom))ASthe_geom,ST_Transform(ST_ConvexHull(ST_Collect(the_geom)),3857)ASthe_geom_webmercatorFROMtestpoints

There’s our Convex Hull! This isn’t very useful on its own, but you could use this new polygon in combination with others in your analysis, or save it as a new table using Dataset from Query in the CartoDB Edit menu.

Buffer

A buffer is simply a polygon whose border is a specified distance from another geometry or group of geometries. The resulting polygon can be used as a visual element on the map, or can be used for further spatial queries (this is not optimal, but that’s another blog post. Check out how Andy uses it in this academy lesson on finding blues musician birthplaces within the Buffer).

Let’s see about the creation of buffers in QGIS. In the screenshot below, you’ll see a buffer running on testpointsfeet. This is our original testpoints dataset converted from WGS84 to NY State Plane, as Buffer will always use the units of the selected layer’s coordinate reference system. Buffers in degrees wouldn’t be very useful, so switching to NY State Plane (EPSG:2266) allows us to run the buffer in feet. (1312.24 feet = 400 meters) We can see the new polygon layer is a series of circles around the original points. If these were real features, such as Restaurants or Dry Cleaners in an area, we can imagine the new buffers showing us their 5-minute delivery areas.

qgismenu

There’s also a handy checkbox in the wizard that allow us to dissolve the resulting buffers into a single feature. Let’s see what this looks like:

qgismenu

Where the original buffers were overlapping, we now see them consolidated into a single polygon.

Now let’s run the same buffer in CartoDB using ST_Buffer(). The docs tell us that there are 4 ways we can call ST_Buffer(), 3 of which are expecting a geometry type plus the units for the buffer, and one which expects a geography type plus meters. (More on geography vs geometry here.) CartoDB’s the_geom column is a geometry, so we can recast it as geography using ::geography as it is passed to ST_Buffer(), then recast the results back to ::geometry for mapping. So, our first pass at a 400m Buffer query looks like this:

SELECTST_BUFFER(the_geom::geography,400)::geometryasthe_geomFROMchriswhong.testpoints

Just like before, we have to include the_geom_webmercator for CartoDB to map the results, and that requires using ST_Transform() again:

To dissolve the results just like we did in QGIS, we’ll use the ST_Union() PostGIS function:

Here’s an example of buffers used in a finished map, showing 5 and 10-minute walking circles around Boston’s Subway Stations.

Thanks for reading! In the next installment, we’ll cover the PostGIS equivalent of Intersect and Union. Stay tuned to learn how the power of PostGIS can make your maps shine.

Happy Mapping!!


Geocamp ES: unconference in Seville

$
0
0

This weekend almost 80 people gathered in a nice country house located in the middle of the park of El Alamillo in Seville at Geocamp ES to discuss open data, open source and geospatial information. Geocamp ES 2015 is the third edition of a conference series following the lead of Geocamp in Portugal. Past editions where organized by Geoinquietos Galicia in Vigo and A Coruña and this year Geoinquietos Seville took the flag to organize this unconference. The format of Geocamp ES is a one day event with some of the talks programmed and the rest of them proposed the very same day. The schedule is finally defined at the beginning of the conference with a relaxed timing to give time for discussion while others talks are shorter and focused to the topic.

Seville

In my case I gave a talk about four use cases of CartoDB applied to the access and visualization of geospatial data, focusing on some aspects that make CartoDB different and special: the easiness to develop web mapping applications without the need to deploy any other components than pure HTML/JavaScript code consuming CartoDB Maps and SQL API. I also discussed using the convenient CartoDB JavaScript library, the rich expressiveness of Spatial SQL to perform geospatial analysis and the flexibility of CartoCSS to define cartography rendering rules. I didn’t had any questions immediately (maybe it was too technical) but afterwards discussions came about how to use CartoDB.

Apart from my talk there were other interesting proposals like the work enthusiastically done by the technicians of the Cartography Institute of Andalucía to maintain updated the regional street map (Callejero Unificado de Andalucía), where they collaborate everyday with public administration employees of sometimes incredibly small and low tech equipped municipalities. Their passion was eloquently described by Paloma López: “I work hard because without soul there’s no project”.

Another great talk was delivered by Juan Carlos, the manager of the FabLab of the University of Seville. He explained the concept of a FabLab (born at MediaLab at MIT) and how it can provide anyone with tools to innovate on the development of real concepts and designs, ones that can make a difference both in academic and social settings. With a low budget but a lot of hard work and passion, FabLab Seville like many other laboratories around the world are putting design, engineering and innovation in the hands of everyone that has interest in it. According the presenter, FabLabs are to design and innovation what libraries are to literacy and education.

Juan Carlos from FabLab

Other interesting talks were about 3D rendering, research about improving our cities, the risks inherent in caching the metadata that our online activity traces, problems with Spatial Data Infrastructures, the application of modern web mapping techniques to heritage studies, security improvement for cyclists and other sports practitioners through improved mobile applications or the possibilities of cartograms to express density maps.

Many talks supported great discussion afterwards and that’s, in my opinion one of the big differences between this unconference and more traditional formats. The low number of attendants and the relaxed organization of the conference enables free expression and the sharing of opinions. Still as always, some people prefer more intimate discussion and breakout sessions are perfect for this.

Break

After the conference Andrés Nadal, a historian from Barcelona, provided a great tour of the city. His tour highlighted fascinating stories about the history and governance of the city, and notable personas like Miguel de Cervantes or Bartolomé Esteban Murillo; the perfect ending to a great day.

On Sunday two complementary activities were organized by Geoniquietos Seville, a Mapillary photo walk and a little practice of geocaching. Pau Gargallo from Mapillary was the host for the first activity; after some training six groups went to take hundreds of pictures of the city centre to cover some historic streets. Afterwards, the geocaching local group of Seville proposed a “scavenger hunt” for micro treasures, hidden in different places near the city centre. For me, it was the first real experience on this activity even I’ve known about it for a while.

Geocamps are a great opportunity to join both professional and community aspects of geospatial research and software development; spending a weekend with a good group of geonerds from Spain and Portugal is always refreshing. Where we will have our next Geocamp? an Iberian Geocamp was discussed to join forces with our friends of Portugal next summer. We’ll see.

Breaking News for Data Journalists!

$
0
0

newspaper

In the high-speed world of data journalism it’s always important to stay on top of the latest story. Being able to quickly and beautifully visualize information in creative ways is essential! That’s why our team here at CartoDB is committed to not only providing the go-to world-class journalism mapping tool, but we’re also cultivating a journalism mapping community with efforts such as training sessions, journalism conferences and events, and now, our bi-weekly CartoDB JournoNewsletter!

CartoDB’s JournoNewsletter is carefully crafted every other week and specifically tailored for journalists and newsrooms. Each issue will be chock-full of ready-to-use links to newsworthy maps, tools, and other journalism resources. Want to sign up? Just fill out the form below and you’ll be on your way to journalism mapping goodness!



Breaking News and CartoDB

As we mentioned before, it’s crucial for journalists to quickly and effectively make insightful and beautiful maps. With CartoDB, news team have the power to make fully interactive publish-ready maps in no time. Take a look at this breaking news maps following the prison break escapees manhunt in New York!

This map was created just moments after DNA from one of the escapees was found in Owls Head, NY.

With Satellite imagery basemaps built into CartoDB, telling compelling news-stories is easy! Take a look at this interactive map telling the story of how the convicts escaped:

For this map, we created our own data in CartoDB by using the built in add features button.

Stay tuned to CartoDB for more academy lessons, events, and journalism resources. Don’t forget to sign up for the JournoNewsletter for more up to date journalism maps and resources. Enjoy, and as always…

Happy data mapping!

Revisiting Cesium

$
0
0

With the deprecation of Google Earth API and Earth Enterprise we receive a lot of questions about how CartoDB can be a viable alternative to provide a 3D environment for geographical information. On this post we share with you a new iteration after our first post. Publishing 3D geodata with CartoDB and consuming it with Cesium makes a perfect match with all the benefits of a modern open web architecture based on reliable APIs and decoupled components.

CartoDB combined with Cesium offers features non present on the Google Earth API like on the fly retrieval of data using complex spatial SQL queries or the expressiveness and advanced cartographic capabilities of CartoCSS.

On this new example we use again our own Imagery provider to fetch CartoDB tiles using CartoDB.js through our Maps API but it also retrieves GeoJSON features using our SQL API. That’s almost a complete use case for all our platform components!

Based on the Cesium layers manipulation example, we offer to the user a layer selector to change the base layer, activate and deactivate different layers, change their transparency and reorder them.

The layers then have two components, a tiled source configured on the code using the typical SQL + CartoCSS combination and a vector source.

{user_name:cartodbUser,sublayers:[{sql:'SELECT * FROM ward_offices',cartocss_version:"2.1.0",cartocss:'#ward_offices {polygon-opacity: 0.7; '+'line-color: #FFF; line-width: 1.5; line-opacity: 1; }'+'#ward_offices[political_="ALP"] {polygon-fill: #b20838; } '+'#ward_offices[political_="IND"] {polygon-fill: #FFA300; } '+'#ward_offices[political_="LNP"] {polygon-fill: #163260; }'}]}

The vector source for the polygon layers is retrieved with the ST_Centroid PostGIS function, so we get only a pin to draw on top of our tiles. This way we can provide a complex symbols definition expressed on CartoCSS but also the metadata of the feature on a way the user can ask for easily.

SELECTcouncilloras"Councillor",political_as"Party",wardastitle,ST_Centroid(the_geom)asthe_geomFROMward_offices

Cesium supports the Mapbox geojson simplestyle spec but in this example we override the default pin image (look for the dataSource.load(data) function).

Finally on this example we control both the layer visibility events and when the user click on features, this way we can easily move the information panel to the pin position and detect when the roads layer is visible and load a panel with an image referencing the url stored in one of the fields of the camera table.

One step further on this example would be to configure custom infowindows for our features, in a similar way we do at our editor. We only have to add a new description property to our features with the HTML content we want to show instead of the default grid. Do you want to try it? Just fork our labs-cesium github repository and hack the Queensland example and show us what you can do with CartoDB and Cesium.

Happy data mapping!

Common Google Maps Engine Workflows, now in CartoDB

$
0
0

With the news that Google is shuttering its Google Maps Engine product (GME) in less than a year, many new clients have come to CartoDB in search of a “new home” for their geospatial needs. For organizations still looking at migrating from GME to CartoDB, our partners over at CloudSherpas have covered in detail both “why” CartoDB is a great choice and the technical “how” of the transition (hint: it’s easy!). But any large organizational software migration can be challenging to wrap one’s head around, which is why we wanted to go a step further and compare, 1-on-1, some common workflows and uses of GME (right from the GME documentation) and how one would accomplish those same tasks within CartoDB. Read on to discover just how easy it can be to move to CartoDB!

tiles

Upload and Style Vector Data for Viewing on the Web

(from GME’s “Upload and style vector data for viewing on mapsengine.google.com”)

A vector data file defines geographic features: points, lines and polygons. See the topic on supported formats in the CartoDB Documentation.

Once your data is imported, you can use CartoCSS to define visual aspects for your points, lines, and polygons, such as point marker styles (fill color, opacity, width, etc); line styles (dashing, width, color, etc); polygon styles (fill color, opacity, border width, etc); and label styles (text face, size, positioning, etc).

Workflow in brief:

  1. Upload the vector data file (along with the associated sidecar files in a zip file if necessary, for example a zipped shapefile) by using the CartoDB Editor or making a request to the Import API directly (example). (Supported formats.)

  2. Go to your CartoDB Dashboard (YOUR_USERNAME.cartodb.com), go to “Your Datasets”, and open the new Dataset that was created after your file was imported.

  3. Style the data by configuring a wizard or by manually editing the CartoCSS.

  4. Set the Dataset’s privacy settings to determine who can see the data. Consider that you can still create a “public map” out of private data, or a private map out of public data. See “What are private maps?” for more detail.

  5. Create a new Map by clicking the “Visualize” button in the top right corner of the CartoDB Editor and enter a name.

  6. Share your new Map by clicking the “Share” button in the top right corner of the CartoDB Editor and use one of the given options (Get the link, embed it, or use CartoDB.js).

Insert Vector Data Incrementally

(from GME’s “Insert vector data incrementally”)

Instead of uploading all the features at once via a file upload, as described in the above scenario, you can also insert new data over time as needed.

This workflow is useful when your application needs to collect data or offers a user interface where people can add features, for example.

Workflow in brief:

  1. Create a new empty Dataset in the CartoDB Editor.

  2. Navigate to your new Dataset.

  3. Using the “Add column” button on the grey right sidebar and the column headers, create any new columns that you need and set their data types.

  4. If it’s a private Dataset, you’ll need to copy your API key. (Find your API key).

  5. Add features via the CartoDB SQL API.

You can interact with the CartoDB SQL API directly with REST calls, or use one of the official client libraries. Here’s an example of inserting a point into a table with the python client library:

fromcartodbimportCartoDBAPIKey,CartoDBExceptionAPI_KEY='YOUR_CARTODB_API_KEY'cartodb_domain='YOUR_CARTODB_DOMAIN'cl=CartoDBAPIKey(API_KEY,cartodb_domain)try:printcl.sql("insert into mytable (the_geom,foo,bar) values (CDB_LatLng(40.7127,-74.0059),'testing',123)")exceptCartoDBExceptionase:print("some error ocurred",e)

Upload Imagery

(from GME’s “Upload imagery for viewing on mapsengine.google.com”)

A raster image is a geo-referenced image. CartoDB supports GeoTIFF images. See the topic on supported formats in the CartoDB Documentation.

Workflow in brief:

  1. Create a new empty table in the CartoDB Editor.

  2. Upload the GeoTIFF raster data file.

  3. Go to the CartoDB Editor (YOUR_USERNAME.cartodb.com).

  4. You will see a new Raster Table item in your table list. Currently, you can only interact with images in CartoDB over the SQL API, i.e., you won’t be able view your GeoTIFF in the CartoDB Editor.

For the import, follow the example in the Import API documentation. Here’s an example of creating a map with a CartoDB Raster Table and CartoDB.js.

For smaller images or small sets of images, it’s often far easier to use either the Google Maps API to create a ground overlay(s) with the image(s), or CartoDB.JS (which follows Leaflet.js functionality) to create an image overlay(s) with the image(s).

Upload and Process Large Volumes of Imagery

(from GME’s “Upload and process large volumes of imagery”)

If you are interested in using large volumes of imagery (usually from aerial photographs), read this full guide on “Serving raster tiles from Google Cloud Storage to CartoDB”.

Integrate CartoDB Data into a Custom Map

(from GME’s “Integrate Google Maps Engine data into a custom map”)

There are a number of options for integrating and visualizing CartoDB Datasets in your own application.

Update your data on CartoDB

(from GME’s “Update your data on Google Maps Engine”)

The CartoDB SQL API provides full SQL access (and thus, CRUD operations - create, read, update, delete) to public and private (with an API key) CartoDB Datasets. Each Dataset is a table in CartoDB’s PostgreSQL database. For optimization tips on updating, inserting, and “upserting” data through the SQL API, check out this blog post.

You can also use the CartoDB Editor - either the SQL query pane or clicking and typing in table cells in the “Data View” to update records in a Dataset.

Synchronize your Data Store with CartoDB

(from GME’s “Synchronize your data store with Google Maps Engine”)

This workflow is useful if you want to use CartoDB as a geospatial analysis and/or publishing platform for analyzing and/or exposing data to customers or the world, and to treat another platform or database as the canonical data store. In this way you can take advantage of the PostGIS geospatial analysis and mapping features, sharing capabilities, and scalability offered by CartoDB.

In such a case, you will need to keep the Google Maps Engine data in sync with your canonical data store. There are a few ways to do this, each with their own advantages and complexity:

“Pull” data into CartoDB on a schedule with Sync Tables:

Most CartoDB plans, and all Enterprise plans, offer “sync tables”, which can pull data from a remote file and refresh their contents on a periodic schedule specified by the user. The remote files that sync tables pull from may come from services like Google Drive or Dropbox, or a public URL accessible to CartoDB via HTTP or HTTPS.

  • Sync tables can be created easily, either with the CartoDB Editor (no programming required) or programmatically via the Import API.

  • Sync tables require your data to be accessible to CartoDB - public, essentially.

  • Sync tables are “destructive”; each time the sync happens, CartoDB deletes its old version of the table and recreates a new table from the remote source. Another way to think of this is that CartoDB’s version of the data gets overwritten each sync, not“appended to.”

“Push” data into CartoDB with the SQL or Import APIs, or OGR2OGR:

If your canonical data store is not public; or you don’t want CartoDB to overwrite its version on each sync and want to instead “append” new data; and your data store or middleware has the ability to run scripts and/or call APIs, these “push” methods are for you. You can issue SQL queries using the SQL API, including UPDATE and INSERT, to “push” updated data to CartoDB. You can also push data into new tables with the Import API. Finally, you can use the ogr2ogr tool in the open-source GDAL library to append data into existing CartoDB tables as discussed in this blog post.

  • You can issue fine-grained SQL queries to CartoDB to update only a few properties of a particular record, or insert (“append”) only a few records, rather than having to sync the whole dataset/table. The rest of the data in the CartoDB table will be unaffected.

  • This method may also be useful for uploading “snapshots” of your data to CartoDB. Your canonical data store can “dump” or otherwise export a snapshot of data on a schedule, and then push the snapshot to CartoDB with any of the SQL API, Import API, or ogr2ogr.

Direct Connections to External Databases:

CartoDB is built on PostgreSQL, and thus supports PostgreSQL’s “Foreign Data Wrappers” (FDW) technology for connecting directly to external databases. There are two ways to use FDWs with CartoDB, and the choice depends on the volume of data you are syncing and whether your database needs to process the data before sending it to CartoDB. Both methods require low latency, direct connections to your database. If you are interested in these FDW approaches, please contact us for more details so we can help find the best fit for your needs.

  • FDW with Materialized Views and refresh: This method works if the data in your canonical data store that you are synchronizing with CartoDB is relatively small (< 100MB), and CartoDB can do any querying or processing necessary. A “materialized view” uses a query to fetch its data (like a view), and also stores this data (like a table). Materialized views combined with an FDW allow you to issue a traditional SQL query to CartoDB, which then translates and submits that query to your canonical data store in a format your canonical data store accepts. When CartoDB receives the queried data, it translates the data back into a tabular format which can be mapped and analyzed from then on within CartoDB. Each time a query or “refresh” command is issued, CartoDB can update the contents of its materialized view from your canonical data store.

  • FDW with Live Queries: This method is best suited for situations where your data is complex or high volume, and your canonical data store must execute computationally complex queries or processing to prepare data to be mapped in CartoDB. Using a more complex FDW, CartoDB can issue queries to your canonical data store, where your canonical data store translates the query, processes the data, and sends the processed data back to CartoDB in a SQL-compatible tabular format, ready for mapping.

Manual export/upload:

If for some reason you cannot use scripts or APIs with your canonical data store, or CartoDB cannot access data stored there via an HTTP/S URL, and FDWs are also not an option, as a last resort you can export data files and upload them to CartoDB manually.

  • Export the data as a file from the canonical data store.

  • Upload the data file using the CartoDB Editor, which will create a Dataset in CartoDB.

  • Create a new Map with the Dataset as a layer.

  • Analyze and style using SQL and CartoCSS. Set the Map’s privacy and share it with a link, embed code, or CartoDB.JS.

  • When the time comes to update the data, you can optionally delete the outdated dataset in CartoDB, re-export a file from your canonical data store, and upload it to CartoDB. Keep in mind that once you delete a Dataset in CartoDB, any Maps that used that Dataset will also be deleted. If you create a new Dataset, your Maps will still work, but you will have to edit them to point to the new Dataset.

Upload data to CartoDB and query it with SQL

(from GME’s “Upload data to Google Maps Engine and query it SQL-style”)

This workflow is useful if you want to use CartoDB as a canonical data store or as an exploratory data analysis environment. It’s not essential to create a map with your data in CartoDB if you just want to query and analyze it. Unlike Google Maps Engine, CartoDB supports the complete set of Structured Query Language (SQL) as the PostgreSQL database, in addition to the geospatial-specific SQL functions of PostGIS.

Workflow in brief:

  • Upload data to a CartoDB table. The data does not necessarily even need to be geospatial in nature if you are not planning to create a map with it.

  • Use the Editor’s SQL pane, or the SQL API to issue dynamic queries. The SQL API can return the queried data in a variety of formats, including GeoJSON.

Unlike Google Maps Engine, each table in your CartoDB database is accessed via the same SQL API endpoint, just as if you were querying from the “psql” interactive terminal. For details on SQL commands, see the PostgreSQL documentation and the PostGIS documentation.

Welcome Roger!

$
0
0

Roger Keren

Roger worked at Accela as the Director of Solution Sales Consultants for North America. Before that he worked as a Public Sector Employee. Creating statewide GIS programs to inform and improve critical land use and environmental planning decisions. Roger earned his Bachelor’s Degree in Environmental Sciences, followed by a Master’s Degree in Urban and Regional Planning. He was an adjunct professor at Rutgers University teaching courses in GIS and public policy.

Roger brings 15 years of experience as a practitioner, educator, and solution sales consultant on the use of technology and GIS platforms as a means to improve the business of state and local government. It was my pleasure to learn more about my new co-worker over lunch.

Let’s get to know him : )

You’re clearly passionate for technology in the public sector - how did that start?

I’m a big believer in public officials adhering to a mission of public service to the people of their communities. There are lots of ways to be a good public servant. But a critical aspect is having the right tools for doing it effectively, specifically around understanding and making decisions around issues.

I view technology as perhaps the most important tool for enabling public service. Technology provides officials a full and actionable understanding of issues in their communities. It can communicate their policies in understandable ways, and gives citizens a voice as individuals or collectively.

Is this what got you interested in leading North American business development at CartoDB?

As you can tell from my background, I’ve always had a soft spot for the use of location-based data and GIS technology. As I began learning more about CartoDB, I was obviously impressed by the beauty of the product. But what was really got me excited was learning how passionate they are about using maps and locational data and as business intelligence platform. Once I understood that, I realized this was a place I wanted to be!

That sounds like a familiar story! I’m sure you’ve had some pretty great experiences with GIS as a student, practitioner, sales consultant, and even an educator. Do you recall any “ah-ha!” breakthrough moments that had positive impact on your work today?

By far it was starting and leading a NPO in Jersey City. Bergen Communities United is focused on improving the quality of life of residents in Jersey City. As a Co-Founder and first President, my job was to find common ground between groups of peoples beliefs and agendas about complex land use and safety issues. In the end, we accomplished some amazing results that I’m proud of. It really opened my eyes to the importance of seeing things from different perspectives and my ability to motivate people.

So, people. Not technology?

Right it was really about finding alignment between people’s goals and finding solutions that were win win. It sounds simple, but it changed my perspective.

While I’m a transplant, I understand you’re a native New Yorker. Where is something I, or anyone visiting, needs to go?

That’s easy. When the weather’s nice, walk from Manhattan over the Brooklyn Bridge to a pizza shop called, Grimaldi’s. Expect to wait in line, but it’s worth it! If you don’t have time to wait, or are just too hungry, there’s another amazing place next door call Juliana’s. A fun fact is Juliana’s is the site of the original Grimaldi’s. Grimaldi’s has a long and colorful history, but that’s a story for another day. You can’t go wrong with either choice. But the most important thing is taking your pie over to Brooklyn Bridge Park to eat your pizza with the best seat in the house.

More hard hitting questions… your spirit animal. What is it?

(laughs and pauses) Probably a meerkat - but stay with me for a minute. It’s amazing how they’ve developed a sense of community and allegiance to one another. The fully understand that they are stronger and healthier working together than they are as individuals. I have a similar outlook on things, so I’m probably a meerkat.

Very cool answer. Ok next question - what something new you’re interested in learning about?

Always wanted to learn Spanish. Now that I have so many people to practice on, I might pick it back up again. I just hope I don’t become a pain.

Very final question. An alternate career path? What would it be.

Oh, no question- jukebox consultant! My services would be to visit various establishments to make recommendations on the songs the jukebox should be playing based on the crowd, time of day, weather, etc. I think people recognize and appreciate when the right songs plays at the right time, at the right place, and circumstances. My job would be to make sure that happens all the time. Great for customers and great for business.

Welcome Brad Songer!

$
0
0

Brad Songer

Brad is the newest member of our business development team. He will be working with our partners to ensure that we’re helping them succeed in building fantastic location analysis tools with CartoDB. Most recently, he managed partner relationships at Google.

Roger: I had the pleasure to meet one-on-one with Brad Songer at one of his favorite burger joints, Blue Collar. “I like simple food done well”, he told me as we entered the no frills burgers and shake shack. “Burgers, hot dogs, fries and shakes is all we do here”, the hostess told me. “And we do it better than anyone else,” she said with confidence and a smile. Brad ordered his cheeseburger and shake. I ordered a cheeseburger with french fries to share.

So what were you doing before joining CartoDB?

Brad: I was a Program Manager at Google on the Google Maps for Work team. Everyone at Google wears lots of hats and works on different projects, but my primary focus was collaborating with a key group of strategic Google Maps partners on product roadmap and go-to-market strategy. Prior to Google I spent 6 years at Esri in the sales organization. I joined as an Inside Sales Associate but over time earned more responsibility, eventually working on a small team spearheading key business development and market expansion initiatives. It’s not lost on me that I’ve been really fortunate to work alongside some bright and passionate people bringing location-based solutions to the consumer and enterprise marketplace.

Roger: That makes me want to check in on Foursquare. Hold on a second… Okay.

Allow me to paraphrase one of my favorite quotes from Office Space. What do you say you’ll be doing do here at CartoDB?

Brad: As Partnerships Director for North America, I’m providing leadership around the design and management of CartoDB’s business partner program in the US and Canada. A major focus today is helping our partners migrate Google Maps Engine customers over to the CartoDB Platform. I collaborate with colleagues and executive leadership to shape the future of CartoDB’s partnership strategy, which is already involving some exciting conversations I know customers will be excited to learn more about.

Roger: This is clearly something that excites you?

Brad: Oh man, absolutely! The most exciting projects in my career have involved building and maximizing business partnerships. They create revenue streams and market opportunities for the partners, while customers benefit by getting the core strengths of two or more companies in a combined solution that’s far more valuable than the sum of it’s parts. This dynamic is what makes partnerships really rewarding, and always worth the effort to discover and make successful.

Roger: I’m pumped! So when you’re not working, what are you doing to unwind?

Brad: My wife Stacey and I have two little ones that we adore, Landon (almost 4 yo.) and Elaina (2 yo.). We love watching them be creative and discover things which usually involves little art projects, or “bug hunts” in the back yard. Our latest “milestone” is picking up the worms we find under logs. At my suggestion, of course, they rush over to show them to mom, which she really appreciates! I’ve had lots hobbies over the years, but nowadays I take every chance I get to create memories as a family. Thanks to your own local suggestion a few days ago, we’ll probably end up visiting Fire Island this summer to see what a neighborhood looks like without cars!

Roger: So tell me something funny or unique about yourself.

Brad: (laughs followed by a deep sigh and a grin) There might be friends or family reading this who would love to answer this questions for me so I’ll share a few to give the question justice. First, I’ve figured out (very slowly!), how to cut my own hair. Most people think that sounds ridiculous, and they’re probably right. But I had a terrible time finding a barber after college. Now I’m convenienced I can do it better than anyone! Something else odd, I’m a happily retired bodybuilder! It was a one-and-done experience back in 2008. Eventually I realized I’d put in the years of work in the gym along with clean eating habits to have a chance of competing successfully. I hooked up with a coach, followed a maniacal diet and conditioning plan to absolute perfection, and ended up winning the champions trophy in two classes and was the runner-up overall winner. It was a defining personal moment for me, but not a lifestyle I could sustain. And finally, if those first two sound too self-serving, I’ll confess to being a “crier.” Sentimental movie or TV plots have an annoying ability to get me choked up. Even certain things in sports get me. Honestly it’s comical, but I’ve realized there nothing I can do about it.

I ended up eating all the fries. “I don’t need anything extra. This shake finished the job nicely!”, said Brad.

Love Wins!

$
0
0

What a victorious last week’s Friday! The Supreme Court of the United States announced today, June 26, 2015, the legalization in ALL states of same-sex marriage. The timing couldn’t have been more perfect. Last week was the last of the Supreme Court’s term and the beginning of Pride Week in two major U.S. cities: San Francisco and New York City.

Marriage equality is now the law of the land.

To honor this monumental moment in history and to show our support we’ve created a Torque Category map using our Twitter API to share how powerful and exciting this new court decision is. The map features some of the top trending hashtags within the first few hours of the ruling. The hashtags have been color-coded using the ubiqitous hues of the Rainbow Flag created by Gilbert Baker.

CartoDB is always proud to stand by justice and equality.

Read the decision at the United States Supreme Court’s website.

Also take a look at an awesome map of the Pride Parade Route over the years from our great friends at LinePointPath.

Happy Pride and Happy data mapping!


Code For America and CartoDB: A new partnership for Civic Good!

$
0
0
cfa

CartoDB has always been committed to empowering communities, people, and organizations that seek to use mapping and data for civic prosperity and growth. From our long-running climate and non profit grants, to sponsoring mapping meetups across the country, we are always looking for new ways to support efforts that re-think how data, mapping, and programming impact civic engagement.

This is why our team is proud to announce a new partnership with Code For America, one of the leading organizations dedicated to building open source technology and organizing passionate people all to make government services simple, effective, and easy to use. Code For America is a leader in providing iterative, user-centered, and data-driven approaches to government challenges primarily in four areas that have real human impact: health, economic development, safety & justice, and citizen-government interaction. Their efforts are showing new ways that we can make governments work better.

September 30 - October 2, the CartoDB sponsored Code For America Summit takes place in Oakland, California. The summit is a roll-up-your-sleeves conference that brings together representatives from hundreds of governments across the U.S. along with civic-minded technologists, designers, community organizers, and entrepreneurs; and the CartoDB team could not be more excited to be a part of the action!

Along with sponsoring the Code For America Summit, we have been working to engage Code For America 2015 fellows and brigades from over 40 cities across the United States! If you are interested in some of the ideas we have been talking about, take a peek at a presentation we gave back in June. Stay tuned for more news about Code For America and CartoDB and if you get to the Summit be sure to save some time to meet the CartoDB team.

Happy data mapping!

Map of the Week: Here Be Dragons, or How to Make Adventure Maps

$
0
0

When we talk about maps in our present, we often forget the intrepid legacy of mapmaking in our past. Some subtle reminders of the struggles behind our geographic sensitivities still hold strong; names like “Mercator” and “Coronelli” echo in our projections and account plans at CartoDB, but rarely do contemporary cartographers think about our own maps as being particularly pioneering, or the product of an adventure.

Sea Monsters Oh my!

This week’s featured mapper still holds to the epicness of exploratory maps. Anthony Goddard runs a small project called ZeroSixZero, which builds custom realtime tracking maps for expeditions and adventurers. Read on to learn how he makes maps that track the trails of post-modern pioneers!

We forget with the navigatory-ease of slippy maps that the making of a mappa mundi was once a non-trivial operation, requiring exploration and often adventure. Do we remember a time when sea monsters marked coordinates of whole continents? Not really. Or can we recall a time when frontiers were defined not only by political imposition, but by the mythology of a terra incognita? Unlikely. But can we comprehend the epic trail of an adventure as it plots on our self-made map-sterpieces? Possibly.

That’s what Anthony Goddard’s work is all about, and in this week’s post, we invite him to share some of the narratives he builds in maps!

London2London

In 2011, at the age of 25, Sarah Outen hopped in a kayak and began paddling down London’s River Thames. There were other kayaks in the Thames that day, but whereas most people were out for a leisurely spring-time paddle, Sarah had other plans. Sarah, like the other paddlers, was paddling back to shore in London. Unlike the other paddlers, she was taking a detour first - via the rest of the world.

Follow the incredible journey of Sarah Outen

Odyssey

When I came across Sarah’s expedition, I was blown away by the scale of it and contacted her to ask if she would be interested in sharing the data, which she kindly agreed to. I added all of Sarah’s historical tracking data to CartoDB and then, data in hand, set about finding the best way to visualize it. Sarah already had a basic and functional map on her website and I didn’t want to just replace that map for her, I wanted to make it way better.

Adventurers on the (Bike) Trail

I’ve worked on many maps, from Oceanrowers to record breaking athletes and even folks unicycling the world!

Here’s another tracking Anna McNuff’s run through the length of New Zealand:

Most of these maps follow a general pattern - a GPS linestring, a marker, and perhaps some statistical overlays or progress markers / popups. Sarah’s expedition was so big that I didn’t feel that any of these formulae could really convey the scale of it. By the start of 2015, when I began work on her map, Sarah had already cycled across Europe and Asia, rowed across the Pacific, kayaked the Aleutian Islands, and was now cycling across Noth America. As she was making her way across the country, I came across Odyssey.js, a project by CartoDB for telling interactive stories with maps, and I knew I had found my answer to Sarah’s map.

The Data

I had been continually syncing data from Sarah’s tracker to CartoDB, so I had all the data I needed. Sarah’s journey consisted of a number of segments, and I wanted the viewer to easily differentiate between them. To do this, I added a category field for each position and, based on the timestamp of the position, allocated a route name as the category. I then used a category line style in CartoDB to render a color for each category. For the latest position, I uploaded an image of Sarah’s boat which would show her on her next leg, rowing the Atlantic. With this visualization complete, I added the viz.json link to Odyssey.js and then began writing the story. Odyssey allows you to write, with simple markdown, a story with embedded coordinates, and allows the user to travel to these key places and times while reading the story.

Sarah had also been recoding “phonecast” updates on her satellite phone for the expedition, and by screen scraping data from her blog posts, and then using additional javascript in the Odyssey map, I was able to add these phonecasts as an optional layer in the map, allowing the viewer to hear what it was like along the places shown in the odyssey map, in Sarah’s own voice.

Phonecasts with Sarah

Cartodb.js

With the challenge of showing the history of the expedition solved, I then needed to design a map to show Sarah’s realtime progress on the current, final leg of her expedition. The realtime map would add things like weather overlays and additional metadata for positions along the route, as well as up to date telemetry from Sarah’s tracker.

Live tracking with data overlays

To do this, I switched to Cartodb.js. On Sarah’s tracking site, users are shown both maps, allowing them to switch between historical and realtime information. The weather overlays are provided by OpenWeatherMap and loaded using Leaflet tilelayers, and a control layer, as follows:

varsea_surface_pressure=L.tileLayer('http://{s}.tile.openweathermap.org/map/pressure_cntr/{z}/{x}/{y}.png',{attribution:'Map data &copy; <a href="http://openweathermap.org">OpenWeatherMap</a>',opacity:'0.5',});varwind=L.tileLayer('http://{s}.tile.openweathermap.org/map/wind/{z}/{x}/{y}.png',{attribution:'Map data &copy; <a href="http://openweathermap.org">OpenWeatherMap</a>',opacity:'0.3',});varoverlayMaps={"Sea Surface Pressure":sea_surface_pressure,"Wind":wind,};L.control.layers(null,overlayMaps,{collapsed:false}).addTo(map);

Mapping Adventures

CartoDB, with tools like OdysseyJS and CartodbJS, has made it possible to build tracking maps that are highly customized for each adventure, adding data and context that previously wasn’t possible with off-the-shelf tracking solutions. Oftentimes the only mechanism for people to follow expeditions is blog posts and maps. My goal with ZeroSixZero is to allow the viewer to feel as close as they can to the adventure they’re following, and push the boundaries of adventure mapping.

If you’d like to view more of Anthony’s maps, check out his public profile, tweet him @anthonygoddard, or contact him via ZeroSixZero.

Stay tuned for our next Map of the Week feature, and meantime happy mapping !

Build Connections through GROW.LONDON

$
0
0

Explore all the varying possibilities of London business infrastructure with GROW.LONDON, a geographic visualization tool developed to help businesses and investors identify key areas to invest in, grow, and expand in the London metropolitan area. Using the power of CartoDB, GROW.LONDON is mapping toward a global urban future where knowledge of diversifying business analytics helps make better decisions and better cities. By visualizing different sets of data using CartoDB’s platform, it’s possible to make accurate business predictions that will likely frame the landscape and competition of an ever enterprising city.

Grow London
"The GROW.LONDON project had a set of complex requirements. One of them was the capability to easily update some of the maps. In a typical scenario, we would have had to create a complex and expensive back-end interface; with CartoDB, however, this possibility comes right out of the box and allows us to readily manipulate data on hover and on click. Our client can use the built-in user interface to update and test the data for all the maps in the project."Manuel Timita, Founder of Illustreets.

Launched by JLL and London & Partners, GROW.LONDON is a fully interactive online platform that provides a new axis of data and insights about key location and business decision-making factors. The Map London tool on their website allows businesses to explore tube, rail, air connectivity, and Crossrail commute time improvements. Additionally, CartoDB’s easy to use cloud-based GIS solution allows for beautiful and clear representations of London’s neighborhoods and districts. By creating mapping visualizations a business can measure population growth, economic output, housing prices, emerging market clusters, and a timeline of developments can all be tracked across London.

"GROW.LONDON visualizations, created with CartoDB, allow our businesses to unlock the potential opportunities that a city like London offers. CartoDB’s versatility (multi platform) and ease of use makes it the perfect technology for our audience". Nacho Moreno, GIS Analyst at JLL.

Discover how London’s urban landscape is changing and how this will impact your business decisions. Explore a visualization of London’s current residential markets and annual price change. The possibilities are endless with CartoDB’s innovative geo-spatial mapping Platform and Editor.

Grow London

London’s expanding population and economy needs world class infrastructure. These interactive maps show the extensive existing city development networks as well as planned and prospective infrastructure projects, which will support London’s future competitiveness.

Enterprise Spotlight: EstateBlock

$
0
0
estateblock

Last week CartoDB had the pleasure of speaking with entrepreneur and real estate map guru Dan (Vadim) Marusin. He is the founder of EstateBlock, a Vancouver Canada based real estate search engine startup powered by CartoDB! Dan discovered CartoDB out of a need to provide easily accessible, high quality, data-secure interactive maps to provide his clients something that had not been done before in Vancouver: provide in-depth and easily accessible insight to home owners and buyers. Below, Dan shares his story.

A Better Real Estate Startup

EstateBlock is an innovative real estate search engine with all MLS listings and all new construction developments in Vancouver, BC and the surrounding area. We started this website a couple of years ago and have become one of the most popular real estate websites in BC, by offering a ridiculous amount of exclusive data to prospective BC home buyers. Data that is not available from any other website.

Like any other startup, we wanted to make a change in the industry. Real estate websites in Canada are usually very simple, and do not provide useful information about the listing and neighborhood, aside from the general MLS information. We decided to step up and gathered as much information about listings and neighborhoods as we could, such as crime rates, comparable listings, school ratings and school service areas, and demographics data for every street in Greater Vancouver, including information on income, education, median age data, transit, daycares, noise from the roads, airports and seaports, electromagnetic fields, pollution from big power lines, and even climate data. We consulted hundreds of sources to give every home buyer a full picture of every property in Greater Vancouver.

"I tried it and totally fell in love with the absolutely magnificent interface, which is very simple, yet extremely flexible, and advanced when you need it to be."

Why Maps?

When we gathered all this information, we started to think about the best way to share it. First we tried graphs and charts, but they proved difficult to read, and even harder to consult when comparing data with other neighborhoods. We quickly settled on maps as the best possible solution for working with this kind of data. At a glance, every person can fully understand, for example, the crime situation in their neighborhood and compare it with all other neighborhoods in Greater Vancouver. But there was one problem: nobody in our team had any experience with maps.

I personally downloaded QGIS and started to study it bit by bit. I spent several months creating maps in QGIS and fine-tuning them for our needs. As an example we created hundreds of layers to cover any demographics criteria you could think of. Education, income level, number of kids in the families…you name it! All this information is now available on our website for every street in Greater Vancouver. Being an extremely lean startup at this time, we started to work with Google Fusion Tables, a free option that I found, to display our maps on the internet and for using them on our website as part of the application. But right away I understood that, since these maps are our competitive advantage, they need to be protected and secured from content scraping. Fusion Tables had an option for securing maps, but the cost was overwhelming and I started to search for an alternative.

estateblock

Tapping into the Power of CartoDB

One of the alternatives I investigated was CartoDB. I tried CartoDB’s free account as a trial and totally fell in love with the absolutely magnificent interface, which is very simple, yet extremely flexible and advanced when you need it to be. The best thing about CartoDB is that you don’t need any coding skills to create stunning maps or to understand any of the many manuals available. The last and most important feature of CartoDB, was the ability to secure maps that I spent months on, to protect them from content scraping. I also love the fact that CartoDB is growing with us and adding more and more features for real time applications.

More Functionality

When we launched EstateBlocks, we were getting calls from users every day to tell us that our heat maps were extremely useful and informative. We decided to go further and we started thinking about how we could use GIS and CartoDB, not only to show heat maps as a layer, but to actually use geographic information systems to filter properties, by proximity to SkyTrain stations for example, so the person who would like to live no more than a five minute walking distance from a SkyTrain station could filter their results and see only the homes matching that criteria. We created a rating for all public and private schools in Metro Vancouver based on exam marks, test results, graduation rates, etc., and collected data about school service areas, some of which required us to go to the school board to scan and digitize paper maps. Now our users can filter homes by proximity to the school and for example, show homes only serviced by good schools.

estateblock

We work with our clients 24/7, so we know exactly what they are looking for when they search for homes. Many people want to be within walking distance of good schools, while some are searching for a low crime area, and for others it is vital to grab as many sunny days as possible. It was a surprise for some clients to find out that West Vancouver receives three times as much rain as Delta, even though they are only 30km apart. We have lots of people coming to the province for the first time and our heat maps are the best way to find out what neighborhood suits them best. I think it is vital for home buyers to operate with facts and numbers, and not the opinions of realtors or second-hand anecdotes.

Noise, EMF Pollution Filters

One of the main unsolved problems we encountered was figuring out how quiet the area around the home was before going there. For example, when we are showing our clients seven homes a day, usually two or three of them will be too noisy due to nearby railroads, airports, or major roads, and sometimes houses are too close to power lines, which is a deal breaker for clients concerned about EMF pollution. This made it a waste of time for both buyers and realtors to go to these places. We started thinking about how we could tackle this problem with CartoDB. We were researching this problem for at least half a year, and are finally launched a new update with options to filter out noisy homes or homes with nearby power lines, to ensure greater client satisfaction.

The best thing about this is that you can combine all these filters. Instead of going through hundreds of listings that you don’t want, you can fine-tune your search for your perfect home, receive email alerts about any new listings that fit all of your criteria the same second the listing shows up in MLS, and book a showing right away to see the property with one of our realtors that same day, all free of charge of course.

Some of the maps that we produce are finding their way to our blog. The two brightest examples of these maps are the Vancouver land prices map and the Immigrants of greater Vancouver by population map.

The Vancouver land prices map is showing the price per square foot for parcels of Vancouver land. All of the data displayed on the map is from Vancouver’s Open Data Catalogue. We were using 2014 BC Assessment data from tax reports and current parcel polygons. It’s a super simple map to make. I usually prepare polygons and data in QGIS, export it to CartoDB as a Shapefile file, and distribute colors using CSS in CartoDB. If data is good and it matches the polygons, these maps can be done in one or two hours without any coding skills!

This map was the first big success for us in terms of PR. We posted it on our blog, and from there it was picked up by several big Vancouver media companies and became viral on Facebook. Over the course of a few weeks we had 15,000 visitors to our blog, and a couple dozen subscribers. Maps like these are a great, free way to attract traffic, build backlinks for websites, and build awareness about your company and the services you provide.

The Immigrants of greater Vancouver by population map basically repeated the success of the first map, in addition to catching the attention of the worldwide mapping community and becoming one of the most popular maps on reddit.

"...with CartoDB the only limit is our own imagination."

What’s Next For EstateBlocks?

I was asked by one of the clients if we can filter non-feng-shui-friendly homes, and I think we can do this. We will research how interesting this feature could be for our users and implement it using CartoDB.

Every day we are thinking about new ways to serve our clients’ needs, and to make their experience more and more informative and the truth is with CartoDB the only limit is our own imagination.

Happy data mapping!

Advanced Map Styling Techniques

$
0
0

Recently, I was working with an utility company that wanted to use CartoDB as a web mapping platform replacement for the way they currently generate maps of their physical infrastructure: AutoCAD.

Maps in AutoCAD? Yes! As in many industries, utilities have requirements for very precise and specific map designs. Sets of inlets, connection points, electrical components, and pipes and cables can be housed close together or in intricate formations. It’s important for field technicians to be able to tell the difference by looking at their maps, which need to convey this level of detail and precision.

The utility company was hesitant about whether CartoDB would suit their needs, which included:

  • custom symbology
  • symbol rotation
  • custom labeling and label placement
  • a variety of line types (colored, dashed, etc)
  • rotation of the map from true North

These are intricate requirements we don’t often see in web mapping, but CartoDB is more than capable and up to the job! Here’s how we handled it all:

Custom Symbology

This was probably the simplest requirement. CartoDB has three sets of interesting symbol icons for you to use with your maps straight out of the box, but we also support uploading your own! SVG icons work best for multiple zoom levels and sizes, but other image files work well too. In this case, the utility had a set of common trade symbols to use for different categories of their infrastructure assets. See below a representative screenshot with four different types of symbol in play:

Custom Symbology

Symbol Rotation

Once we had custom symbol icons uploaded, the next requirement was that these icons be rotated according to a “rotation angle” column in the dataset. This is important as some asset classes were placed along roadways that curve and turn, and portraying their position and orientation was important to the client.

The rotation column had a simple number of degrees from 0 that each asset’s record needed to be rotated by. CartoCSS is an extensive language with many symbolizers and properties beyond what most people commonly use. One of these is the marker-transform property, which you can feed any SVG transformation function. What is an SVG transformation function? There are six mentioned in the W3C’s SVG specification, one of which is rotate(a, x, y). This function will rotate a graphic “a” degrees around a point (x,y). Even though our markers are PNG and not SVG, we can use this function in our CartoCSS along with our rotation column in our data for an appropriate rotation by record, as seen below:

#transformers[subtypecd=3]{marker-file:url(https://s3.amazonaws.com/com.cartodb.users-assets.production/production/athompson/assets/20150409160916transformerSinglePhaseUGcd3_trans.png);marker-width:10;marker-transform:rotate([symbolrotation],0,0);}

Notice how well the rotated symbols follow the curvature of the road below!

Symbol Rotation

Custom Labeling and Label Placement

Utility maps can be information dense - not only is the symbology and positioning important, but the text labels are too. Moreover, this particular client had labels in their CAD maps split into two lines, and composed of several data fields. This too is an intricate but doable job for CartoCSS using some basic string operations, such as including an escaped newline character and concatenating a few fields in the “text-name” property. Due to the length of these labels, we also set them to appear only at close zoom levels so they didn’t overload the map. Also, CartoCSS labels have the ability to be positioned in several compass rose directions, and you can even specify an algorithm to try a few of these positions so the labels don’t get drawn overlapping each other with the text-allow-overlap, text-placement-type, and text-placements properties.

#transformers::labels[zoom>=17]{text-name:[facilityid]+"\n"+"-"+[operatingvoltage]+[phasedesignationdesc];text-face-name:'DejaVu Sans Book';text-size:10;text-label-position-tolerance:0;text-fill:#000;text-halo-fill:#FFF;text-halo-radius:1;text-dy:-20;text-allow-overlap:false;text-placement:point;text-placement-type:simple;text-placements:"N,E,S,W";}

Notice how the tight cluster of components below have labels that don’t overlap each other:

Label Placement

Line Styling

CartoCSS’ versatility is not limited to just point markers - lines also have an impressive array of options for styling that’s not immediately apparent if you’re just using the CartoDB wizards. The utility we were working with had traditional ways of representing its wiring systems as lines of different widths and “dashings” depending on the type of wire. Enter CartoCSS’s line-dasharray property to the rescue!

#priugelectriclinesegment{line-width:3;line-opacity:0.7;}#priugelectriclinesegment[subtypecd=1]{line-color:#FF5700;line-dasharray:7,3;}#priugelectriclinesegment[subtypecd=2]{line-color:#FF5700;line-dasharray:7,2,2;}#priugelectriclinesegment[subtypecd=3]{line-color:#FF5700;line-dasharray:13,2,4,2;}

The line-dasharray property takes an array of numbers to define dash lengths and spacing lengths. Using this property, it’s possible to create uniformly dashed lines, lines that have long dashes followed by short dashes with short spacing, dashes that are the same length but have different spacing every so often, or some combination! The below shows 4 types of line in action:

Dashed Lines

Map Rotation

The vast majority of web maps are in North-up Mercator-type projections. This can be a challenge if your organization has legacy maps that portray information in different regions with different standard compass roses. In this utility company’s case, they were very interested in continuing the “deviation from true North” display their technicians had gotten used to. This is not an operation CartoCSS can solve, but thanks to CartoDB’s full embrace of PostGIS, putting a direction other than North “up” is something we can do by manipulating the data with SQL. ST_ROTATE will rotate your data by a number of radians (you can find compass degrees to radian converters easily online) and ST_TRANSLATE will move (or translate) your data by a certain x and/or y delta.

Now, you cannot manipulate your basemap with SQL. So this rotation technique best works with a blank color basemap. You can download the features you’d like in a basemap from OpenStreetMap, such as roads, and import that into a CartoDB table you can also rotate and translate just as much as your main data, and make a multilayer map. Storing the entire Planet.osm file in CartoDB would take a lot of storage, so this is best for small areas!

Below is the general SQL query to accomplish this:

SELECTcartodb_id,other_fields,ST_TRANSLATE(ST_ROTATE(ST_TRANSLATE(the_geom_webmercator,-1*center_x_webmercator,-1*center_y_webmercator),-pi()/4),delta_x_webmercator,delta_y_webmercator)asthe_geom_webmercatorFROMyour_table

A few points to note:

  • other_fields: any other columns you want to select when you make this translation, for instance ones you’re using to set CartoCSS. If you don’t select them individually, they won’t be part of your new translated dataset!
  • center_x_webmercator and center_y_webmercator: This is the centroid of your data, in webmercator coordinates. You could find this with select ST_AsText(ST_Centroid(ST_Union(the_geom))) from your_table;
  • delta_x_webmercator and delta_y_webmercator: These are the number of web mercator meters of delta to translate your points after they have been rotated. After the rotate your data will likely be far, far away from where it was originally - this won’t really matter much unless you’re using a basemap (which will be wrong after rotating your data, anyway), and you could use the centroid x and y from above here as the delta x/y as well. If you want the points to appear roughly near where they were originally, you’ll need to come up with a delta.

Alternatively, you can translate and rotate by the_geom and about a regular lat/long centroid, but to get the resulting dataset to display in CartoDB, you’ll need to “Create a new dataset from your query”, ie, create a new table after running the below:

SELECTcartodb_id,other_fields,ST_TRANSLATE(ST_ROTATE(ST_TRANSLATE(the_geom,-1*center_x,-1*center_y),-pi()/4),delta_x,delta_y)asthe_geomFROMyour_table

Regardless, once you’ve done the translate-rotate-translate shuffle, here’s the effect you’ll see:

Rotated to East Up

Pretty cool!

What advanced maps will you create with CartoCSS and SQL?

Happy data mapping!

Viewing all 820 articles
Browse latest View live