The base map is from 1:10m #NaturalEarth. Map rendering is via the browser using #D3js and #GIMP for compiling the GIF animation.

The Sun position calculation is adapted from #Wikipedia and #Turfjs is used to generate the terminator line from the Sun’s position.

https://en.wikipedia.org/wiki/Position_of_the_sun
https://en.wikipedia.org/wiki/Equation_of_time

🧵 2/2

Position of the Sun - Wikipedia

This uses #TurfJs polygon length function to calculate its circumference. The underlying sorting of the coordinates uses polar coordinates, since that is how they are being randomly generated. By first sorting over the degrees and the distances.

For most instances this is a pretty good estimate, though in some case a self-intersecting polygon can be created, which hints that there is a more optimized polygon.

Further this problem is a typical 'travelling salesman problem' which can be solved via various algorithms.

Though before considering such optimization issues, there is the main question if the randomly generated POI is even accessible to the public.

In the case one is a pedestrian, one could use #overpass to gather information if any #OpenStreetMap highways exist in the proximity to the POI and then find the one that is the closest and permissive to pedestrians. Then move the POI to that location.

This example only works if there is enough #OSM data at the location.

#mathematics #maths

Toying around with the idea of creating a random POI generator which can be used as a #StarCourse or an optimization challenge to navigate throughout the POIs.

This tool is required for the #SagaOfTheRuckers navigator challenge.

Tools: #TurfJs #Leaflet #OpenStreetMap #WebDev

Wow, I just submitted a pull request for Turf. That hasn't happened for a long time.

https://github.com/Turfjs/turf/pull/2814

#turfJS

Support (Multi)Point,FeatureCollection and GeometryCollection in bboxClip by stevage · Pull Request #2814 · Turfjs/turf

Fixes #2813 Also, small change to existing behaviour to return Multi* objects with no coordinates instead of defective Polygon and LineString objects. That is, instead of a Polygon with coordinates...

GitHub

For those who use the Turf.js JavaScript library for GIS/mapping work. Turf 7.2.0 has been released, which fixes a lot of edge case bugs by replacing their `polygon-clippling` dependency with `polyclip-ts`.

https://github.com/Turfjs/turf/releases

#JavaScript #Nodejs #TurfJS #Turf #GIS #Mapping

Releases · Turfjs/turf

A modular geospatial engine written in JavaScript and TypeScript - Turfjs/turf

GitHub

The Bing ML buildings data is from this GitHub repo and first released in 2022: https://github.com/microsoft/IdMyPhBuildingFootprints

I used the following tools/services:
▪︎ @geofabrik for the OSM buildings
▪︎ #OverpassTurbo for extracting clipping polygons from OSM
▪︎ Osmosis for filtering the OSM buildings
▪︎ @qgis #QGIS for GeoJSON clipping and data conversion
▪︎ A couple of hand-coded Perl scripts for data manipulation
▪︎ #TurfJS
▪︎ #LeafletJS for rendering
▪︎ H3 for hexbinning
▪︎ @GIMP #GIMP for final map prep

🧵 3/4

GitHub - microsoft/IdMyPhBuildingFootprints: ML generated building footprints for Indonesia, Malaysia, and Philippines

ML generated building footprints for Indonesia, Malaysia, and Philippines - microsoft/IdMyPhBuildingFootprints

GitHub

I was helping an #UrbanPlanning friend with some spatial analysis with #QGIS but the project seemed to be running out of her 8GB memory.

I advised a #FrameworkLaptop with more memory. She got the DIY option, which lead her to consider her OS choice, which lead her try #Linux (#Ubuntu), which is what she installed after testing it.

Now we'll get back on track using #QGIS / #Docker / #Valhalla / #TurfJS to explore some spatial analysis ideas.

I've now published a write-up and the source code for how I calculated a connectivity rank which could be used to help prioritize how a bike network is built out based how segments would improve connections with the existing network.

https://mark.stosberg.com/bike-network-connectivity-rank/?ref=mastodon

Thanks to all the open source mapping projects that helped make this possible, including #qgis #valhalla #josm and #turfjs. And yes, I used JavaScript for this.

Feedback, improvements welcome!

#mapping #spatialAnalysis #minneapolis

Calculating Connectivity Rank for Bike Network Planning

You've got a plan to build out a 100 miles of of additional bike facilities. Which ones should you build first to make the biggest impact? In addition to all the metrics that would usually apply to bike lane planning, now there are a few others that are interesting to

Mark Stosberg

Currently waiting on my old laptop to merge 3,476 isochrone polygons into a single MultiPolygon, 🤞 that it doesn't crash part way through.

#turfjs does crash in cases like this, so I'm using `polyclip-ts`.

Another project I'd like to get to is submitting a pull request to the Turf.js project to switch to using polyclip-ts internally, so it doens't crash either. Discussion about this spread across a few issues. One of them is here:

https://github.com/Turfjs/turf/issues/2409#issuecomment-1662873720

1,500 polygons left to merge...🧵

Odd bug in @turf/difference calculation · Issue #2409 · Turfjs/turf

Using turf 6.5.0 I get an odd error in a very specific case and I cannot understand why. import { difference, Polygon } from "@turf/turf"; const area1 = { type: "Polygon", coordinates: [ [ [ 11.799...

GitHub