-
Notifications
You must be signed in to change notification settings - Fork 346
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
Ensure hoels of polygons have correct handedness #3139
Conversation
Do not trust the incoming data. For polygons with holes that need to be filled, we ensure the holes have a different handedness than the parent, reversing the child if needed. Closes #3135.
OK, this works but there is some other bug from externals that probably is not looking for the -Ph option.
but does not make it transparent when I remove the -Gblue from second segment header. So -Ph is in fact ignored.
|
Maybe make a mex version of the test? |
Use your Julia. Life is much easier with it
|
OK, fine. I just installed/update julia to 1.3.1. Followed your macOS hint of addint startup.jl. Then tried ]add GMT and ERROR unexpected ]. |
Am I completely missing any instructions for actuallly installing GMT.jl?. |
Last version is Julia 1.4 but 1.3 is just as good. |
Seems like your instructions is missing some critical spaces between ] and add. Works now. |
Ah, because you copy-pasted? |
Yes, but also the README.md has no space. |
Now here: |
FYI, the adding package seems to work?
|
Ok, you should not need it but better to have the master version |
Ah sorry, I know. It's like Python. Before using any package you have to import it. So first command per session has to be |
D = gmtread("quad.dat"); I put the startup.jp in config with path to my library dir and restarted. julia |
Ok the other user that passed through this had to do |
I added a call to Libdl in startup.jo before the LIB call. Same error. |
OK, using Libdl works. |
Good. I debugged to confirm that the header is well transmitted to GMT. And mex version confirms the same thing. No hole. |
So when I debug MEX I have to load in gmtmex.c (compiled for Xcode) into Xcode, set a stop point, start matlab, connect Xcode to MATLAB processes, then run the matlab command. |
You may need to add a "how to debug" section. |
Anyway, in the GMT io we do this:
so the hidden helper structure per segment sets a flag. When gmt read returns to mablat it has the info:
What does your Julia D data have? |
Ok, dinner time here (still preparing it). In Julia you get the same thing as in Matlab . Have a function for display that only shows first segment. To see more you do
|
As far as I can tell, when D is passed back into a matlab gmt call the header is extracted and copied into the GMT segment header so it should work - I just need to rebuild gmtmex here. |
I verified that it is indeed like that from Julia, but -Ph makes no effect (tried with both -Ph -Gblue and -Ph |
Don't want to try a debug from Julia?
Ofc never tried in Mac but that's what I do on Windows. |
OK, it makes sense to set stop point in the GMT C in Xcode. I will see - as you know multi-tasking on this end during the day... |
BTW, I updated the installing instructions so you can give a star to the project. |
* doc: Fix references to GMT defaults (#3132) * Auto-generate gmt_moduleinfo.h * Fix new bug in filterwidth parsing for median filter (#3137) I recently introduced this bug. * Better check if no barwidth given in -D (#3138) With nothing we are thrown into the deprecated parsing and it did not check if nothing was given. Closes #3136. * Ensure hoels of polygons have correct handedness (#3139) Do not trust the incoming data. For polygons with holes that need to be filled, we ensure the holes have a different handedness than the parent, reversing the child if needed. Closes #3135. * Make info go to GMT_MSG_INFORMATION * Fix extending the grid in grdcut (#3142) * Fix extending the grid in grdcut When grdcut -N is used we can extend the grid beyond its domain and fill in the new areas with NaNs. However, if the new region was not kosher and changed the domain by an integer number of pixels our algorithm for filling in NaNs got tricked and the result was a new grid with a bunch of zero nodes. This PR checks for this case and adds a sanity check as well. * Update grdcut.c * Remember to also flip curves with -N with -A is used (#3145) Needed to flip the x and y coordinates when plotting the pdf curves when -A is used. Closes #3141. * Fix wrong string comparison when converting berween GMT and GDAL ellipsoid names (#3143) * Let set_tbl_minmax make hole connections (#3146) Since datasets may come to us via external interfaces we need to look for polygons with holes and hook things up. * Major revision of grd2kml (#3144) * Update grd2kml.c Fix the quadtree. * Update grdvector_common.rst_ * Update grd2kml.c * Update grd2kml.c * Update grd2kml.c * Update grd2kml.c * Update grd2kml.c * Update grd2kml.c * Update grd2kml.c * Update grd2kml.c * Update grd2kml.c * Update grd2kml.c * Update grd2kml.c * FInalize module * Remove junk update docs * Update grd2kml.c * Add -S option * Update grd2kml.c * Update grd2kml.c * Update grd2kml.c * Update grd2kml.c * Update grd2kml.c * Allow JPGs vs PNGs * Eliminate -Q * Handle grdiline grids * Fix both grdcut and grd2kml use of it. * Fix contours * Update grd2kml.c * Update grd2kml.c * Update grd2kml.c * Allow variable pen widths It is best to scale down pen widthd for lower levels as otherwise they are just too thick. * Let pen scale/limit be set via modifier +s * Same -A as gmt2kml * Update grdcontour.c * Fix my bug in grdcontour (#3149) I forgot to set the id of the pen before using it... * Limit -J to x|X for histogram (#3148) It currently prints out all the map projections. Closes #3140. * Relegate no contour message back to information (#3150) This was elevated back when -V was required to get any information at all. Since warnings are now default, we move this to information. I also added the same information message to pscontour. * Add the missing entries Co-authored-by: Paul Wessel <[email protected]> Co-authored-by: Joaquim Luis <[email protected]>
* Eliminate duplications * Add title * Update gmt_core_module.c * Redo everything * Update CMakeLists.txt * names... * Update gmt_api.c * Update src/CMakeLists.txt Co-Authored-By: Dongdong Tian <[email protected]> * Update CMakeLists.txt * Update gmt_modules.h * Only shared libraries supported * Eliminate function pointer in struct * Change common_*.[ch] to gmt_*.[ch] * Auto-generate gmt_moduleinfo.h (#3134) * doc: Fix references to GMT defaults (#3132) * Auto-generate gmt_moduleinfo.h * Fix new bug in filterwidth parsing for median filter (#3137) I recently introduced this bug. * Better check if no barwidth given in -D (#3138) With nothing we are thrown into the deprecated parsing and it did not check if nothing was given. Closes #3136. * Ensure hoels of polygons have correct handedness (#3139) Do not trust the incoming data. For polygons with holes that need to be filled, we ensure the holes have a different handedness than the parent, reversing the child if needed. Closes #3135. * Make info go to GMT_MSG_INFORMATION * Fix extending the grid in grdcut (#3142) * Fix extending the grid in grdcut When grdcut -N is used we can extend the grid beyond its domain and fill in the new areas with NaNs. However, if the new region was not kosher and changed the domain by an integer number of pixels our algorithm for filling in NaNs got tricked and the result was a new grid with a bunch of zero nodes. This PR checks for this case and adds a sanity check as well. * Update grdcut.c * Remember to also flip curves with -N with -A is used (#3145) Needed to flip the x and y coordinates when plotting the pdf curves when -A is used. Closes #3141. * Fix wrong string comparison when converting berween GMT and GDAL ellipsoid names (#3143) * Let set_tbl_minmax make hole connections (#3146) Since datasets may come to us via external interfaces we need to look for polygons with holes and hook things up. * Major revision of grd2kml (#3144) * Update grd2kml.c Fix the quadtree. * Update grdvector_common.rst_ * Update grd2kml.c * Update grd2kml.c * Update grd2kml.c * Update grd2kml.c * Update grd2kml.c * Update grd2kml.c * Update grd2kml.c * Update grd2kml.c * Update grd2kml.c * Update grd2kml.c * Update grd2kml.c * FInalize module * Remove junk update docs * Update grd2kml.c * Add -S option * Update grd2kml.c * Update grd2kml.c * Update grd2kml.c * Update grd2kml.c * Update grd2kml.c * Allow JPGs vs PNGs * Eliminate -Q * Handle grdiline grids * Fix both grdcut and grd2kml use of it. * Fix contours * Update grd2kml.c * Update grd2kml.c * Update grd2kml.c * Allow variable pen widths It is best to scale down pen widthd for lower levels as otherwise they are just too thick. * Let pen scale/limit be set via modifier +s * Same -A as gmt2kml * Update grdcontour.c * Fix my bug in grdcontour (#3149) I forgot to set the id of the pen before using it... * Limit -J to x|X for histogram (#3148) It currently prints out all the map projections. Closes #3140. * Relegate no contour message back to information (#3150) This was elevated back when -V was required to get any information at all. Since warnings are now default, we move this to information. I also added the same information message to pscontour. * Add the missing entries Co-authored-by: Paul Wessel <[email protected]> Co-authored-by: Joaquim Luis <[email protected]> * cmake: Simplify the regex for building gmt_moduleinfo.h (#3153) * Eliminate old gmt_supplements_module.[ch] Made gmt_suppl_glue.[ch].in after gmt_glue.[ch] and gmt_suppl_modules.h after gmt_modules.h and the contents of the old gmt_supplements_module.h. I include gmt_suppl_modules.h from gmt_dev.h and gmt_suppl_glue.h from gmt_api.c. I updated the CMakefile to configure the two new files. All compiles but currently the gmt_suppl_glue.[ch] file says "core" instead of "suppl" in the function names. * Update src/CMakeLists.txt Co-Authored-By: Dongdong Tian <[email protected]> * Update CMakeLists.txt * Build gmt_suppl_moduleinfo.h (#3154) * Eliminate gmt_modules.h and gmt_suppl_modules.h * Update CMakeLists.txt Need correct name * Ignore modules.h files * Add EXTERN_MSC to all module functions * Build gmt_suppl_moduleinfo.h * Finalize new api build via Cmake Local tests run fine on macOS * Use GMT_SUPPL_LIB_NAME Cmake variable instead of hardwired "supplements" * Update cmake/ConfigDefault.cmake Co-Authored-By: Dongdong Tian <[email protected]> * Eliminate glue include files (#3159) * Eliminate glue include files Since the glue functions are not called as is anywhere, their names are only assembled via strings and obtained via a pointer from dlsym, there is no purpose to gmt_glue.h and gmt_suppl_glue.h. Just added EXTERN_MSC to the functions in gmt_*glue.c instead. * Eliminate suppl_glue in repo * Update comments for BUILD_SHARED_LIBRARIES * remove unused file and macro * Update CMakeLists.txt * Delete gmt_make_module_src.sh * Update CMakeLists.txt * Update MB-system files * CI: Remove gmt_make_module_src.sh from CI testing (#3160) gmt_make_module_src.sh is no longer used and was removed in branch new-api-lookup. * Update gmt_glue.c.in * Update gmt_glue.c.in * Rename Gmt_libinfo struct type to GMT_LIBINFO Stick with our conventions * cmake: Extract gmtread and gmtwrite module information from source codes directly (#3163) * Rename vars (#3164) * Rename SUPPL_* toSHARED_LIB_* * Update gmt_glue.c.in * Update src/CMakeLists.txt Co-Authored-By: Dongdong Tian <[email protected]> * More documentation * Move settings closer to library building Co-authored-by: Dongdong Tian <[email protected]> * GMT_SUPPL_LIB_NAME was defined on Windows only (#3166) * cmake: Make the CMake file more readable (#3167) Co-authored-by: Dongdong Tian <[email protected]> Co-authored-by: Joaquim Luis <[email protected]>
Do not trust the incoming data. For polygons with holes that need to be filled, we ensure the holes have a different handedness than the parent, reversing the child if needed. Closes #3135.