Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support geo types. #176

Open
marcbinz opened this issue Aug 5, 2023 · 0 comments
Open

Support geo types. #176

marcbinz opened this issue Aug 5, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@marcbinz
Copy link
Collaborator

marcbinz commented Aug 5, 2023

Describe your feature request
SurrealDB support the usual geo types with explicit querying options. This proposal suggests to add support for those types within the generated layer of som as well.

Are you willing to contribute this feature?
Of course 😉

//
// -- GEO
//

type Point struct {
	Longitude float64
	Latitude  float64
}

// {
//    type: "Point",
//    coordinates: [-0.118092, 51.509865],
// }

type Line struct {
	Points []Point
}

// {
//	type: "LineString",
//	coordinates: [
//		[10.0, 11.2], [10.5, 11.9]
//	]
// }

type Polygon struct {
	Points []MultiPoint
}

// {
//	type: "Polygon",
//	coordinates: [[
//		[-0.38314819, 51.37692386], [0.1785278, 51.37692386],
//		[0.1785278, 51.61460570], [-0.38314819, 51.61460570],
//		[-0.38314819, 51.37692386]
//	]]
// }

type MultiPoint struct {
	Points []Point
}

// {
//	type: "MultiPoint",
//	coordinates: [
//		[10.0, 11.2],
//		[10.5, 11.9]
//	],
// }

type MultiLine struct {
	Lines []Line
}

// {
//	type: "MultiLinestring",
//	coordinates: [
//		[ [10.0, 11.2], [10.5, 11.9] ],
//		[ [11.0, 12.2], [11.5, 12.9], [12.0, 13.0] ]
//	]
// }

type MultiPolygon struct {
	Polygons []Polygon
}

// {
//	type: "MultiPolygon",
//	coordinates: [
//		[
//			[ [10.0, 11.2], [10.5, 11.9], [10.8, 12.0], [10.0, 11.2] ]
//		],
//		[
//			[ [9.0, 11.2], [10.5, 11.9], [10.3, 13.0], [9.0, 11.2] ]
//		]
//	]
// }

type Collection struct {
	Geometries []any
}

// {
//	type: "GeometryCollection",
//	geometries: [
//		{
//			type: "MultiPoint",
//			coordinates: [
//				[10.0, 11.2],
//				[10.5, 11.9]
//			],
//		},
//		{
//			type: "Polygon",
//			coordinates: [[
//				[-0.38314819, 51.37692386], [0.1785278, 51.37692386],
//				[0.1785278, 51.61460570], [-0.38314819, 51.61460570],
//				[-0.38314819, 51.37692386]
//			]]
//		},
//		{
//			type: "MultiPolygon",
//			coordinates: [
//				[
//					[ [10.0, 11.2], [10.5, 11.9], [10.8, 12.0], [10.0, 11.2] ]
//				],
//				[
//					[ [9.0, 11.2], [10.5, 11.9], [10.3, 13.0], [9.0, 11.2] ]
//				]
//			]
//		}
//	]
// }
@marcbinz marcbinz added the enhancement New feature or request label Aug 5, 2023
@marcbinz marcbinz added this to the [v0.3.0] More features milestone Sep 11, 2023
@marcbinz marcbinz removed this from the [v0.x.0] More features milestone May 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant