Last active
October 7, 2017 16:32
-
-
Save misterspeedy/75ff4c8a0d96a0e94f311e8133dad07f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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