This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
We are updating the requirements for Community registration. As of 7/21/21 all users will be required to register a phone number with their My Alteryx accounts. If you have already registered, you will be prompted on your next login to add your phone number.
All - Here is the use case. I have an address, along with the latitude and longitude for that building location. What I want to do is to be able to construct a polygon around the building in alteryx. The maps in alteryx have the building outlines, so surely have the building coordinates, but was unsure if anyone has experience with doing this or if anyone has any recommendations/guidance.
When you view base maps in Alteryx (and most applications), you're actually viewing a saved image of that particular area and zoom level. This means that Alteryx is just returning the image of what the area looks like from a hosted web service (like Mapbox/Catro) or an installed dataset (like TomTom). Images are much faster to load that spatial objects, so that's why they're used, Spatial object may have been used to create those images, but those are kept by the data provider. TLDR: There's no spatial objects to PolyBuild into polygons for the buildings you see in map layers.
The process of geofencing has been increasingly popular with the rise of GPS analytics. Most businesses find it much cheaper and easier to just buy the building polygons from a 3rd party data provider. One example of a provider is SafeGraph.
What's your application? Maybe a small radius polygon around your centroids might work to get you started while you look into options for more detailed polygons.
One minor correction - the TomTom Maps do actually include spatial data for every layer on the map itself - but these maps don't include building footprints. If you want to extract any data from the TomTom maps included with the Location Insights then you can use the TomTom Layer Extraction App that we ship with the Location Insights bundle. Or you can go to the install location of your Location Insights data and grab the raw yxdbs.
While we are on the topic of building footprints - a few years ago Microsoft open sourced all their building footprint data that they use in Bing Maps. I can't speak for the quality or how up to date it is but you can find their github for it here: https://github.com/Microsoft/USBuildingFootprints
Would there be a way to use the Microsoft data and then run that in alteryx? So if the centroid of the building is contained in one of these building footprints, then the polygon coordinates of the building gets returned?
@TravisR Awesome link! I didn't realize that was available!
@Reggie1995 Ok, here's what we do. At the github link above, if you scroll down, there's 50 states (plus D.C:) worth of .zip files you can download. If you download one and extract it, you'll get a .geojson file. Guess what? Alteryx's native text format for spatial objects is geojson, so this just takes one tool!
Steps 1: Download
Download the 51 files from the gitbub linked above. Extract the 51 .geojson files from each. This could be done with Alteryx, but let's stick to the spatial problem at hand.
Step 2: Save as spatial objects
In the attached example, I input Colorado.geojson (that I already downloaded and unzipped), and use a select tool to change it to a spatial format so I can save a Colorado.yxdb (Alteryx file that saves the polygon).
Step 3: Spatial Match
Now that we have a spatial object, we can use it to match from centroids that you already have. Use a Spatial Match tool to find where the centroid you have falls within a building polygon.
Once you get the process above running, here's a few further tips:
- Combine all 51 .yxdb files into one, massive file. Then, In your spatial match tool, use the "Use Records from File or Database" in the tool configuration to input the master file path there. This will mean you don't have to load the entire file every time and the spatial indexing in the .yxdb file can be used, which makes it WAY faster.
- The spatial matching should probably be a multi-step process. 1) use a spatial match tool for when the point falls within a building polygon, then take the unmatched records and input those to a Distance to Nearest tool, for when the centroid is a door that lies just outside the building polygon, you'll match to the nearby polygon.
All - I think we got it. So I used @CharlieS 's steps. I then used a select tool and converted the identified polygon back to text to retrieve all of the points for that polygon and wrote those to the output file. Really appreciate your help on this @TravisR@CharlieS . Exactly what I was looking for.