Published
Edited
Oct 3, 2019
Insert cell
md`# Sql Geom`
Insert cell
wkt = "POLYGON((4239782.739013087 881103.7000072686,4240185.239322281 880978.7511926119,4240240.582194837 880943.2918522347,4240577.509482495 880887.8724856162,4241043.004404114 880974.7195875014,4241257.271937663 880968.0978463916,4241402.475918673 880187.4274816156,4241452.090232092 879600.9266113476,4241491.995081538 879430.9503494351,4241624.203726554 877863.1149793564,4241663.419377132 877670.6462765291,4241722.245539491 877016.2909755573,4241715.6522953855 876802.7275617128,4241504.464377268 876179.1863250808,4241457.9570187 876135.6174532144,4240791.411589211 876122.4587454449,4240643.732515645 876093.2705339149,4240462.909070991 876087.6110353991,4240317.663364703 876137.1090971306,4240126.256046803 876154.282465403,4239119.443351398 876455.4907093887,4238998.852309468 876571.7399366208,4238917.805205626 876506.7451849141,4239058.865148741 876322.353233304,4239088.872108976 876197.658907561,4239099.239320068 875803.5373664307,4239075.634459979 875770.5142602155,4238577.575787008 875729.6973715714,4238533.502008786 875764.8190465056,4238430.815089409 876094.2974547748,4238429.647508208 876420.6221491633,4238511.742369121 876519.3365686182,4238503.252094247 876609.6092696366,4238401.7368377475 876612.7583251751,4238290.685944948 876672.4593935563,4238169.7515331935 876777.4719478663,4238118.238536072 876936.5850960184,4238131.14592305 877352.4673200662,4238167.773819407 877441.3366262034,4238234.6287228605 879959.2834099757,4238175.682802944 880242.3475692758,4238110.110272717 880311.8787219612,4238031.8650335595 880336.8062514376,4237872.932227084 880307.9930237517,4237697.485395339 880110.9534708185,4237514.703114229 879677.9004395071,4237232.15728682 879304.1896039963,4237170.876143385 879148.5962229157,4237052.504111906 878972.2766276641,4237027.152320222 878883.06461879,4236635.390406563 878265.235806935,4236531.784817857 878200.9564338464,4236407.719587579 878204.8164558195,4236330.168058447 878252.23123615,4236224.028340858 878469.2907553188,4236234.522831874 878806.4698361745,4236434.298190311 879059.0036922749,4236560.106845324 879111.33920468,4236652.7795907715 879187.2057803995,4236712.31649264 879286.6027612957,4236994.172710433 879637.8299247521,4237185.798073954 879991.8590250897,4237574.023771863 880497.2648056862,4237934.094247759 880823.5552842426,4238520.045651589 881154.0861822129,4239074.716156509 881204.3780705394,4239782.739013087 881103.7000072686))"

Insert cell
epgs = 2914
Insert cell
wktToGeom(wkt, epgs)
Insert cell
function wktToGeom(wkt, epgs, platform = "MSSQL") {
switch(platform) {
case "MSSQL":
return `geometry::STGeomFromText('${wkt}', ${epgs})`
}
}
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more