Skip to content
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

PHP mapscript - labels not draw with PostLabelCache set #5142

Closed
wants to merge 2 commits into from
Closed

PHP mapscript - labels not draw with PostLabelCache set #5142

wants to merge 2 commits into from

Conversation

tbonfort
Copy link
Member

@tbonfort tbonfort commented Oct 6, 2015

Using PHP Mapscript it appears that when PostLabelCache is set to '1' for a label layer this causes the label text not to display.

With a map file this works as expected.

Looking in the mapscript/php source directory there are mutiple '#ifdef disabled' around the labelcache functions.

@sdlime
Copy link
Member

sdlime commented Aug 28, 2015

Ian, how are you setting the PostLabelCache parameter? Do you have a code snippet? If after you set the parameter if you do a $map->save() or write() (can't remember the syntax) what does the resulting mapfile look like? The behavior doesn't make any sense to me since no value for postlabelcache can disable labeling.

Steve

@ianwalberg
Copy link
Author

Steve,

We have had a closer look and we cannot make sense of what has happened.

It looks like the merge into the trunk was not successful for the php mapscript code as there are multiple differences between the 6.4 branch we had bene using and the 7.0 trunk.

I do not know if say the anti alias and type was removed on purpose, CMakeLists.txt in mapscript/php does not have labelcache.c and labelcachemember.c.

I did make contact with Thomas who sounded like he would be back from vacation next week so hopefully he can explain.

Bottom line is that we believe 7.0 php mapscript is broken.

Regards

Ian

From: Steve Lime [mailto:notifications@github.com]
Sent: Friday, August 28, 2015 11:05 AM
To: mapserver/mapserver mapserver@noreply.github.com
Cc: Ian Walberg ian.walberg@airborne.aero
Subject: Re: [mapserver] PHP mapscript - labels not draw with PostLabelCache set (#5142)

Ian, how are you setting the PostLabelCache parameter? Do you have a code snippet? If after you set the parameter if you do a $map->save() or write() (can't remember the syntax) what does the resulting mapfile look like? The behavior doesn't make any sense to me since no value for postlabelcache can disable labeling.

Steve


Reply to this email directly or view it on GitHubhttps://github.com//issues/5142#issuecomment-135848872.

@sdlime
Copy link
Member

sdlime commented Aug 28, 2015

Have to tried master? I doubt much work was done in PHP/MapScript other than a few small changes made to make things compile - the change around transparency/opacity would be one area.

@ianwalberg
Copy link
Author

Steve,

There are a lot of differences between 6.4 and 7.0 including multiple sections disabled with ifdef’s.

I am not sure how this evolved, from a quick look it feels like these were disabled for development and not re-enabled but I may well be wring.

Regards

Ian

From: Steve Lime [mailto:notifications@github.com]
Sent: Friday, August 28, 2015 11:19 AM
To: mapserver/mapserver mapserver@noreply.github.com
Cc: Ian Walberg ian.walberg@airborne.aero
Subject: Re: [mapserver] PHP mapscript - labels not draw with PostLabelCache set (#5142)

Have to tried master? I doubt much work was done in PHP/MapScript other than a few small changes made to make things compile - the change around transparency/opacity would be one area.


Reply to this email directly or view it on GitHubhttps://github.com//issues/5142#issuecomment-135852328.

@tbonfort
Copy link
Member

tbonfort commented Sep 7, 2015

@ianwalberg can you send a minimal testcase that exhibits this. Setting/getting the layer->postlabelcache hasn't changed as far as I see. The code that was disabled is the direct manipulation of the labelcache and labelcache members themselves which were messing with mapserver's internals and should not have been exposed in the first place (IMO), and were essentially already broken since label priorities were added to mapserver.

@ianwalberg
Copy link
Author

Thomas,

We will get you something this week.

Regards

Ian

From: Thomas Bonfort [mailto:notifications@github.com]
Sent: Monday, September 7, 2015 6:36 AM
To: mapserver/mapserver mapserver@noreply.github.com
Cc: Ian Walberg ian.walberg@airborne.aero
Subject: Re: [mapserver] PHP mapscript - labels not draw with PostLabelCache set (#5142)

@ianwalberghttps://github.com/ianwalberg can you send a minimal testcase that exhibits this. Setting/getting the layer->postlabelcache hasn't changed as far as I see. The code that was disabled is the direct manipulation of the labelcache and labelcache members themselves which were messing with mapserver's internals and should not have been exposed in the first place (IMO), and were essentially already broken since label priorities were added to mapserver.


Reply to this email directly or view it on GitHubhttps://github.com//issues/5142#issuecomment-138301612.

@tbonfort
Copy link
Member

ping @ianwalberg

@tbonfort
Copy link
Member

tbonfort commented Oct 6, 2015

@ianwalberg I'll let you try out the proposed fix attached here and report back.

@ianwalberg
Copy link
Author

Thomas,

Where do we find the attached file?

Thanks

Ian

From: Thomas Bonfort [mailto:notifications@github.com]
Sent: Tuesday, October 6, 2015 6:24 AM
To: mapserver/mapserver mapserver@noreply.github.com
Cc: Ian Walberg ian.walberg@airborne.aero
Subject: Re: [mapserver] PHP mapscript - labels not draw with PostLabelCache set (#5142)

@ianwalberghttps://github.com/ianwalberg I'll let you try out the proposed fix attached here and report back.


Reply to this email directly or view it on GitHubhttps://github.com//pull/5142#issuecomment-145854844.

@tbonfort
Copy link
Member

tbonfort commented Oct 6, 2015

You'll see the diff directly from the issue page on github.

@ianwalberg
Copy link
Author

I rebuilt with the changes to mapdraw.c and the simple test case works now.

We will built our complete application tomorrow and see if this works.

What do you think was happening?

@ianwalberg
Copy link
Author

With the changes to mapdraw.c we now get this error with our full application.

maplabel.c:166: msComputeTextPath: Assertion `ts->annotext && *ts->annotext' failed.

The simple test case seems ok and it will take us a little more time to track down what is causing this error.

What could the error mean?

@tbonfort
Copy link
Member

tbonfort commented Oct 7, 2015

Before sending a complete test case, can you already send a complete backtrace?

@ianwalberg
Copy link
Author

#0 0xb7fff424 in *kernel_vsyscall ()
#1 0x4a9cc687 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#2 0x4a9cdec3 in __GI_abort () at abort.c:90
#3 0x4a9c5727 in __assert_fail_base (fmt=0x4ab15ad8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n",
assertion=assertion@entry=0xb7b4baaf "ts->annotext && ts->annotext",
file=file@entry=0xb7b4ba88 "/data/build/mapserver-7.0.0/maplabel.c", line=line@entry=166,
function=function@entry=0xb7b4bde7 <__PRETTY_FUNCTION
.12352> "msComputeTextPath") at assert.c:92
#4 0x4a9c57d7 in *GI___assert_fail (assertion=0xb7b4baaf "ts->annotext && ts->annotext",
file=0xb7b4ba88 "/data/build/mapserver-7.0.0/maplabel.c", line=166,
function=0xb7b4bde7 <__PRETTY_FUNCTION
.12352> "msComputeTextPath") at assert.c:101
#5 0xb7a05ec6 in msComputeTextPath () from /tmp/navhome/lib/libmapserver.so.2
#6 0xb7a43b50 in msDrawLabel () from /tmp/navhome/lib/libmapserver.so.2
#7 0xb7a419e3 in pointLayerDrawShape () from /tmp/navhome/lib/libmapserver.so.2
#8 0xb7a42a6e in msDrawShape () from /tmp/navhome/lib/libmapserver.so.2
#9 0xb7a3f91e in msDrawVectorLayer () from /tmp/navhome/lib/libmapserver.so.2
#10 0xb7a3eadc in msDrawLayer () from /tmp/navhome/lib/libmapserver.so.2
#11 0xb7a3dc59 in msDrawMap () from /tmp/navhome/lib/libmapserver.so.2
#12 0xb7c6ba85 in mapObj_draw () from /tmp/navhome/lib/php_mapscript.so
#13 0xb7c5ee62 in zim_mapObj_draw () from /tmp/navhome/lib/php_mapscript.so
#14 0x083788b4 in ?? ()
#15 0x0836ca86 in execute ()
#16 0x0830ae5e in zend_execute_scripts ()
#17 0x082b0516 in php_execute_script ()
#18 0x083ac940 in ?? ()
#19 0x083acf94 in ?? ()
#20 0x4a9b7963 in __libc_start_main (main=0x83aca40, argc=2, ubp_av=0xbffff5c4, init=0x83b47b0 <__libc_csu_init>,
fini=0x83b47a0 <__libc_csu_fini>, rtld_fini=0x4a98a8a0 <_dl_fini>, stack_end=0xbffff5bc) at libc-start.c:274
#21 0x080617b1 in _start ()

@tbonfort
Copy link
Member

tbonfort commented Oct 8, 2015

in a138147 I have added a fix for handling empty labels when not using the labelcache, which seems to be your case.

@ianwalberg
Copy link
Author

That seems to have fixed our issue, we will test more today but first tests look good.

@ianwalberg
Copy link
Author

From our tests this looks good. Thanks

@tbonfort
Copy link
Member

applied to branch-7-0

@tbonfort tbonfort closed this Feb 24, 2016
@tbonfort tbonfort added this to the 7.0.1 milestone Feb 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants