USGS-WiM / STNServices

.net Core refactored STNServices2
Other
0 stars 0 forks source link

Set up geojson #13

Open lprivette opened 4 years ago

lprivette commented 4 years ago

Notes from J: So, recently there was a NetTopologySuite (https://github.com/NetTopologySuite/NetTopologySuite) release that handles geojson seamlessly with postGIS and dotnetcore apps I've been using it quite a bit and once you get past the initial setup, I tend to just forget about it. Setup,

• you may (I would recommend) updating to the latest verson of dotnet core... I think 3.x was released a few weeks ago, but I haven't had a chance to update any of my stuff, so I'm still on 2.2 (or something like that) • depending on if you want to work with the postgis implementation or roll your own install nettopolysuite or entityframework version Startup.cs https://github.com/USGS-WiM/GageStatsServices/blob/staging/GageStatsServices/Startup.cs#L82 (if using directly from postgis) https://github.com/USGS-WiM/GageStatsServices/blob/staging/GageStatsServices/Startup.cs#L156-L157 (required for serialization/deserialization of objects) Usage https://github.com/USGS-WiM/GageStatsServices/blob/staging/GageStatsDB/Resources/Station.cs#L43 (from postgis, it just works)