▲ 95 r/geospatial+1 crossposts

Slope bins with MapLibre & GDAL

After a weekend of troubleshooting my slope analysis components are finally done...maybe. Considering adding interactivity by rendering in the frontend as a shader instead of on the backend with GDAL but not sure that's necessary yet.

Some cool things I learned:

  • Elevation tiles are just PNGs with height encoded into the RGB channels, so slope is edge detection

  • Slopes can be calculated pretty easily via 3x3 kernel comparisons and calculating rise over run * 100, BUT the run changes based on zoom and latitude

  • The earth being a globe kinda sucks

  • GIS is hard

Not including the URL here because I don't want to advertise, I just think this looks neat

u/adWavve — 3 days ago
▲ 5 r/civil3d+1 crossposts

Streaming 3DEP COGs into on-the-fly contours + a LandXML TIN surface (side project, looking for holes in my CRS/units handling)

Hello globeheads™,

Tl;dr: I built a web app for engineers / GIS staff to generate basemaps. I'm a backend developer, so I don't really work with GIS "products/output" day to day, and I'd love some feedback from people who do.

Link: https://basemappr.io

It sorta works on a phone, but the output is primarily a CAD file so it's built for desktop.

Guest mode's on, so you don't need to make an account. I'm not tracking anything except your export params, and it's all stored in Supabase if that matters to you.

#Long version:

To save time at work, I built a Python script to pull 3DEP COGs from USGS, turn them into contours with GDAL, and export a DXF for CAD, instead of having GIS staff query USGS REST services by hand.

Then I got tired of running the script for people, so I built a frontend. Then I got tired of reprojecting for out-of-state projects, so I added CRS auto-detection. Then, yada yada, it kinda snowballed from there.

##Stack:

Backend: FastAPI, GDAL, scpy, numpy, PostGIS via Supabase

Frontend: NextJS, Shadcn, Supabase Auth

##Data + processing:

- USGS 3DEP elevation, streamed as COGs off S3 via /vsicurl at native 1m where available, renderingRule=None for raw values.

- FABDEM for bare-earth outside the US.

- State ArcGIS REST services (PA/NY/WV/OH/MD/VA, my firm's primary service area) and OSM/Overpass for vectors.

- GDAL/OGR + rasterio; gdal.ContourGenerate for contours; TIN triangulation for the surface.

##The parts that were actually hard, and new to me:

- Auto-detecting the right State Plane zone from the bbox, and getting US survey foot vs international foot right. A silent meters/feet or survey/intl-foot mixup is a scale error you don't catch until it's in CAD. Just fixed one on the vertical, where the surface Z was in meters while X/Y were in survey feet.

- Emitting LandXML that Civil 3D reads as a native TIN surface instead of baked contours. Strict schema, and the point/face lists and units all have to be right.

I'm primarily a backend dev, not a CAD tech or engineer. The few engineers I've handed it to seem to like it, but I could really use feedback from people who actually work in the industry:

What data sources would you add, and where's my CRS handling most likely to break?

Thanks, and since someone's definitely going to ask: Claude wrote the CSS for this; backend was me over the course of six months. Transparency.®

reddit.com
u/adWavve — 2 months ago