Skip to content

Instantly share code, notes, and snippets.

@misterspeedy
Last active October 7, 2017 16:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save misterspeedy/75ff4c8a0d96a0e94f311e8133dad07f to your computer and use it in GitHub Desktop.
Save misterspeedy/75ff4c8a0d96a0e94f311e8133dad07f to your computer and use it in GitHub Desktop.
namespace Buildings
// Needs Easy GIS from Nuget: https://www.nuget.org/packages/Huitian.EGIS.ShapeFileLib/
// Also need to add a reference to System.Drawing
module Drawer =
open System
open System.Drawing
open System
open System.Drawing
let notImplemented() =
raise <| NotImplementedException()
type PolyLine = PolyLine of PointF seq
type Building = Building of PolyLine seq
/// Get the buildings from a shape file set
let loadBuildings (directoryPath : string) (filePattern : string) : Building seq =
notImplemented()
/// Find buildings in an area
let findBuildings (p1 : PointF) (p2 : PointF) (buildings : Building seq) : Building seq =
notImplemented()
/// Render buildings on a bitmap
let renderBuildings (p1 : PointF) (p2: PointF) (bitmapWidth : int) (foreGround : Color) (backGround : Color) (buildings : Building seq) : Bitmap =
notImplemented()
/// Save the bitmap
let saveBitmap (path : string) (bitmap : Bitmap) : unit =
notImplemented()
/// Get some buildings from a shapefile set, render them on a bitmap, and save the bitmap
let drawBuildings (shapeFilesPath : string) (filePattern : string) (p1 : PointF) (p2 : PointF) (bitmapWidth : int) (foreGround : Color) (backGround : Color) (saveFilePath : string) =
loadBuildings shapeFilesPath filePattern
|> findBuildings p1 p2
|> renderBuildings p1 p2 bitmapWidth foreGround backGround
|> saveBitmap saveFilePath
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment