Categorygithub.com/cridenour/go-postgis
modulepackage
1.0.1
Repository: https://github.com/cridenour/go-postgis.git
Documentation: pkg.go.dev

# README

go-postgis

PostGIS support for Go. Works with any Postgres driver.

Example

package main

import (
	"database/sql"
	"fmt"

	"github.com/cridenour/go-postgis"
	_ "github.com/lib/pq"
)

func main() {
	db, _ := sql.Open("postgres", "database=pqgotest sslmode=disable")

	point := postgis.PointS{
		SRID: 4326,
		X:    -84.5014,
		Y:    39.1064,
	}
	var newPoint postgis.PointS

	// Ensure we have PostGIS on the table
	db.Exec("CREATE EXTENSION IF NOT EXISTS postgis")

	// Demonstrate both driver.Valuer and sql.Scanner support
	db.QueryRow("SELECT GeomFromEWKB($1);", point).Scan(&newPoint)

	if point == newPoint {
		fmt.Println("Point returned equal from PostGIS!")
	}
}

# Structs

Structs respresenting varying types of points.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Interfaces

No description provided by the author