-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
geo: move projection data to embedded compressed file
The geoprojbase package embeds projection info as constants, leading to a 6MB code file. Large code files are undesirable especially from the perspective of static analysis tools, IDEs, etc. This change moves the projections data to an embedded json.gz file. We define the schema of this file in a new `embeddedproj` subpackage. The data is loaded lazily. The data file was obtained by modifying the existing constants to fill out an `embeddedproj.Data`: https://github.com/RaduBerinde/cockroach/blob/geospatial-proj-data/pkg/geo/geoprojbase/embeddedproj/data_test.go The `generate-spatial-ref-sys` command is also updated to generate this file from the `.csv`. The `make buildshort` binary size is decreased by ~7MB. Fixes #63969. Release note: None
- Loading branch information
1 parent
ea6bfb2
commit 5ea5ef4
Showing
10 changed files
with
205 additions
and
92,294 deletions.
There are no files selected for viewing
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
Binary file not shown.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
load("@io_bazel_rules_go//go:def.bzl", "go_library") | ||
|
||
go_library( | ||
name = "embeddedproj", | ||
srcs = ["embedded_proj.go"], | ||
importpath = "github.com/cockroachdb/cockroach/pkg/geo/geoprojbase/embeddedproj", | ||
visibility = ["//visibility:public"], | ||
) |
Oops, something went wrong.