Note: This addon document is for an older version of GRASS GIS that will be discontinued soon. You should upgrade your GRASS GIS installation, and read the current addon manual page.
################################ # decimal degrees and separators ################################ 34.2348,-83.8677 # comma 34.2348 -83.8677 # whitespace #################################################### # degree, minute, and second symbols # degree: ° (U+00B0, °, alt+0 in xterm), o, d # minute: ' (U+0027, '), ′ (U+2032, ′), m # second: " (U+0022, "), ″ (U+2033, ″), # '' (U+0027 U+0027, ' '), s #################################################### 34.2348° -83.8677° # without minutes, seconds, and [SNWE] 34°14.088' -83°52.062' # without seconds and [SNWE] 34°14'5.28" -83°52'3.72" # without [SNWE] 34.2348°N 83.8677°W # without minutes and seconds 34°14.088'N 83°52.062'W # without seconds 34°14'5.28"N 83°52'3.72"W # full 34°14′5.28″N 83°52′3.72″W # full using U+2032 and U+2033 34o14'5.28''N 83o52'3.72''W # full using o' and '' 34d14m5.28sN 83d52m3.72sW # full using dms 34:14:5.28N 83:52:3.72W # full using : 34:14:5.28 -83:52:3.72 # without [SNWE] 34:14.088 -83:52.062 # without seconds and [SNWE]
xy 396255,1374239 396255 1374239
See the following example:
# point geometry # starts in latlon point 10,20 xy 3,4 # poly 1 latlon poly 10,20 30,40 # poly 2 in xy # new coordinate system always starts a new geometry xy 5,6 7,8 # comment ignored and poly 2 continues 9,10 # but not this one because there is a blank line above # start poly 3 11,12 13,14 # bbox latlon bbox 10,20,30,40 xy 5,6,7,8
['point', [10.0, 20.0], 'xy', [3.0, 4.0], 'latlon', 'poly', [[10.0, 20.0], [30.0, 40.0]], 'xy', [[5.0, 6.0], [7.0, 8.0], [9.0, 10.0]], [[11.0, 12.0], [13.0, 14.0]], 'latlon', 'bbox', [10.0, 20.0, 30.0, 40.0], 'xy', [5.0, 6.0, 7.0, 8.0]]
The query and input options support the full query syntax including and, or, xor, and not in the postfix query mode. Unless the query mode is postfix, only one of and, or, or xor must be given as the first word.
This query string performs the AND of all geometries A, B, C, and D, and returns projections that completely contain all of them:
and # A, B, C, or D can be point, poly, or bbox individually A B C D
This query string performs the OR of all geometries and returns projections that completely contain any of them:
or # A, B, C, or D can be point, poly, or bbox individually A B C D
This query string performs the XOR of two geometries and returns projections that completely contain only one of them:
xor # A or B can be point, poly, or bbox individually A B
Since the XOR operator is performed on two geometries at a time, feeding more than two geometries does not return mutually exclusive projections. For example, this query string returns projections that contain only A, B, or C exclusively, and additionally all three geometries:
xor # A, B, or C can be point, poly, or bbox individually A B C
This query string returns all projections that completely contain geometry A, but not B:
postfix A # find A B # find B not # complement of B and # A and not B
This query string returns all projections that contain A or B, but not C: A, but not B:
postfix A # find A B # find B or # A or B C # find C not # complement of C and # (A or B) and not C
This query string returns all projections that contain both A and B, but not C; or those that contain C, but neither A nor B:
postfix A # find A B # find B and # A and B C # find C xor # (A and B) xor C
This query string returns all projections that contain only one of A, B, or C exclusively:
postfix A # find A B # find B xor # A xor B C # find C xor # A xor B xor C A # find A again B # find B again and # A and B C # find C again and # A and B and C not # not (A and B and C) and # (A xor B xor C) and not (A and B and C)
This query string ignores all results above none and returns those projections that only contain X:
postfix A # find A B # find B or # A or B C # find C not # complement of C and # (A or B) and not C none # empty and # ((A or B) and not C) and empty = empty X # find X or # empty or X = X
This query string returns all projections not in degree that contain A:
postfix A # find A unit=degree # restrict queries to degree unit all # find all projections in degree unit=any # back to all units; without this, the following NOT operation # would be performed in the degree-unit universe and return # nothing because the NOT of all in the same universe is none not # complement of (all projections in degree) in the any-unit # universe; that is, all projections not in degree and # A and (all projections not in degree); # all projections not in degree that contain A
This query string returns all projections in xy that contain A that can be transformed to B in EPSG:4326 within a match_tol distance tolerance in xy (default 1):
postfix match_tol=200 # error tolerance in an xy unit for distance matching A # known coordinates in an unknown projection and unit latlon B # known coordinates in latlon that should match A match # find projections in xy that contain A that matches B in latlon
This operator requires the pyproj module and is slow because it has to transform B to many projections that contain both A and B. To save time and just return the first match, use match_max (default 0 for all):
postfix match_tol=200 # error tolerance in an xy unit for distance matching match_max=1 # return the first match only and quit A # known coordinates in an unknown projection and unit latlon B # known coordinates in latlon that should match A match # find projections in xy that contain A that matches B in latlon
See the following example:
postfix # define city geometries, but not used immediately city_A: A city_A: B city_C: C city_X: X # start query :city_A :city_B or :city_C not and :no_where: # saved and used immediately and :city_X or
See the following example:
point 10,20 xy 3,4 # use a space-comma-space to start a new poly latlon poly 10,20 "30 40" xy 5,6 7,8 9,10 , 11,12 13,14 latlon bbox 10,20,30,40 xy 5,6,7,8
CREATE TABLE bbox ( proj_table TEXT NOT NULL CHECK (length(proj_table) >= 1), crs_name TEXT NOT NULL CHECK (length(crs_name) >= 2), crs_auth_name TEXT NOT NULL CHECK (length(crs_auth_name) >= 1), crs_code TEXT NOT NULL CHECK (length(crs_code) >= 1), usage_auth_name TEXT NOT NULL CHECK (length(usage_auth_name) >= 1), usage_code TEXT NOT NULL CHECK (length(usage_code) >= 1), extent_auth_name TEXT NOT NULL CHECK (length(extent_auth_name) >= 1), extent_code TEXT NOT NULL CHECK (length(extent_code) >= 1), south_lat FLOAT CHECK (south_lat BETWEEN -90 AND 90), north_lat FLOAT CHECK (north_lat BETWEEN -90 AND 90), west_lon FLOAT CHECK (west_lon BETWEEN -180 AND 180), east_lon FLOAT CHECK (east_lon BETWEEN -180 AND 180), bottom FLOAT, top FLOAT, left FLOAT, right FLOAT, unit TEXT NOT NULL CHECK (length(unit) >= 2), area_sqkm FLOAT CHECK (area_sqkm > 0), CONSTRAINT pk_bbox PRIMARY KEY ( crs_auth_name, crs_code, usage_auth_name, usage_code ), CONSTRAINT check_bbox_lat CHECK (south_lat >= north_lat) )
g.projpicker -l 34.2348,-83.8677,33.7490,-84.3880
This command finds projections that completely contain two poly geometries separated by a comma:
g.projpicker query="poly -10,0 10,0 10,10 10,0 , 10,20 30,40"
This command finds projections that completely contain two bounding boxes in bottom, top, left, and right:
g.projpicker query="bbox 0,0,10,10 20,20,50,50"
g.projpicker query="33.7490°N,84.3880°W xy bbox 1323252,1374239,396255,434290"
g.projpicker query="postfix match_tol=200 33.7490,-84.3880 xy 432697.24,1363705.31 match"
This process is slow because it has to transform the geometry in latlon to many different projections. Just to return the first match to save time:
g.projpicker query="postfix match_max=1 match_tol=200 33.7490,-84.3880 xy 432697.24,1363705.31 match"
# since the unit name "US foot" contains a space and statements are separated # by whitespaces, it needs to be surrounded by single or double quotes when # it's passed from the command line g.projpicker query="postfix unit='US foot' 34.2348,-83.8677 33.7490,-84.3880 not and" g.projpicker query="postfix unit='US foot' '34.2348 -83.8677' '33.7490 -84.3880' not and" g.projpicker input=- <<EOT postfix unit=US foot # in this case, quotes are optional because this statement is # not followed by other items 34.2348,-83.8677 33.7490,-84.3880 not and EOT g.projpicker input=- <<EOT postfix unit=US foot 34.2348 -83.8677 33.7490 -84.3880 not and EOT g.projpicker input=- <<EOT postfix unit="US foot" 34.2348,-83.8677 33.7490,-84.3880 not and EOT g.projpicker input=- <<EOT postfix unit=US foot A: 34.2348,-83.8677 B: 33.7490,-84.3880 :A :B not and EOT
g.projpicker -g query="postfix 34.2348,-83.8677 33.749,-84.388 not and"
Available at: g.projpicker source code (history)
Latest change: Tue Aug 31 09:21:23 2021 in commit: b8c52758b3a592e68a4322668d1351cf383b97f7
Note: This addon document is for an older version of GRASS GIS that will be discontinued soon. You should upgrade your GRASS GIS installation, and read the current addon manual page.
Main index | General index | Topics index | Keywords index | Graphical index | Full index
© 2003-2023 GRASS Development Team, GRASS GIS 7.8.8dev Reference Manual