1

I want to print a geological legend for a map on which I draw the lithology. I use this for drawing the lihtology:

colornames="/GeologyMapColorCodesAndDocumentation/ColorCodesGeologicMap"
gmt psxy "${map_repo}lithology.gmt" $reg $proj -L -aZ=Code -C$colornames -Zzval -O -K >> $1

With lithology.gmt:

# @VGMT1.0 @GPOLYGON
# @R119.31526783/122.10616999/21.89310323/25.63488771                     
# @Je4326
# @Jp"+proj=longlat +datum=WGS84 +no_defs "
# @Jw"GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]]"
# @NGid|Code|Name|Note|Time|Abbrev
# @Tinteger|integer|string|string|string|string
# FEATURE_DATA
>
# @D1|7010|安山岩|安山岩|更新世|α4
# @P
122.07853538 25.62400028
122.07684956 25.62493342
122.07546161 25.62601781
122.07289488 25.62674301
122.07229883 25.62762748
122.07266463 25.63064419
122.07335464 25.63202019
122.07432764 25.63344375
122.07726916 25.63393434
122.07953347 25.63447953
122.07987601 25.63488771
122.08179566 25.6348216
122.08337494 25.6345549
122.08500313 25.63346865
122.08510312 25.63203494
122.08292455 25.62846982
122.08222477 25.62601977
122.08153516 25.62469572
122.08011729 25.62404049
122.07853538 25.62400028
>
# @D2|7010|安山岩|安山岩|更新世|α4
# @P
122.10424213 25.48121473
122.10308919 25.48213736
122.10247849 25.4831236
122.10257125 25.48480864
122.10320436 25.48627749
122.10372775 25.48781035
etc.

And what I would like is to draw rectangles filled with the code color for each lithology appearing on my map (there are lots of other polygons not appearing on my map, ma map is a subset).

I was thinking of selecting the polygons appearing on my map with:

gmt select "${map_repo}lithology.gmt" $reg > test.txt

But I end up with only the points and no attributes:

>
120.72416514 24.16392437
120.72699135 24.15006498
120.72789158 24.13938717
120.72816222 24.13157955
120.72753278 24.1287816
120.72716142 24.1241218
120.72501945 24.11549495
120.72299921 24.10943261
120.71692221 24.09594517
120.71198933 24.08603074
120.7046417 24.07681128
120.70084365 24.07121021
120.69854872 24.06590545
120.69589904 24.05832681
120.69312775 24.04864854
120.69237669 24.04398786

And even after having the subset of polygons appearing on my map, I am not sure how to proceed to give the correct color value to one rectangle.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.