Ticket #3901 (closed defect: fixed)

Opened 2 years ago

Last modified 16 months ago

PHP MapScript does not implement NEW properties like GEOMTRANSFORM, GAP, LINECAP, LINEJOIN, OFFSET, PATTERN in styleObj

Reported by: iap Owned by: aboudreault
Priority: highest Milestone:
Component: MapScript-PHP Version: 6.0
Severity: normal Keywords:
Cc: regiodata

Description

$style->set('gap', 10); produces the following "Error: propety 'gap' does not exist in this object."

Also symbolObj has properties and methods that are already not supported by MapServer 6: setpattern, getpatternarray, patternlength

Change History

  Changed 23 months ago by regiodata

  • priority changed from normal to highest

We can't use PHP-MapScript? without the new Features. In my opinion there's now no way to render label backgrounds with Mapscript!

I can't understand why 6.0 was released in such a half done status.

follow-up: ↓ 5   Changed 22 months ago by aboudreault

I agree, this is a bad issue. I fixed it and committed in r12080. Could you test your things and let me know if everything seems good please? If so, I'm going to backport this in branch 6-0.

  Changed 22 months ago by aboudreault

btw, about GEOMTRANSFORM, there is a getGeomTransform and setGeomTransform methods.

  Changed 22 months ago by aboudreault

  • cc regiodata added

in reply to: ↑ 2   Changed 21 months ago by regiodata

It works better. But unfortunately "GEOMTRANSFORM" doesen't seem to be fully implemented in MapScript?. For Example a Layer is defined with:

LAYER
	NAME			"test"
	TYPE			ANNOTATION
	STATUS			ON
	[DATA]
	
	CLASS
		NAME	"test1"
		LABEL
			TYPE		TRUETYPE
			FONT		freesansbold
			FORCE		true
			ENCODING	"UTF-8"
			STYLE # bbox
				GEOMTRANSFORM	"labelpoly"
				COLOR			255 255 255
				OUTLINECOLOR	255 255 255
			END
			WRAP '*'
		END
	END
END

After opening the mapfile and saving it with "$ms_map->save($str_filename)" the GEOMTRANSFORM is lost.

 LAYER
    [DATA]
    NAME "test"
    STATUS ON
    TYPE ANNOTATION
    CLASS
      NAME "test1"
      LABEL
        FONT "freesansbold"
        SIZE 2
        COLOR 0 0 0
        ENCODING "UTF-8"
        FORCE TRUE
        OFFSET 0 0
        POSITION CC
        SHADOWSIZE 1 1
        STYLE
          ANGLE 0
          COLOR 255 255 255
          OFFSET 0 0
          OUTLINECOLOR 255 255 255
        END # STYLE
        TYPE TRUETYPE
        WRAP '*'
      END # LABEL
    END # CLASS
  END # LAYER

Because we need a preprocessing with MapScript? the problem seems not solved.

  Changed 21 months ago by regiodata

seems to work with a simple fix in mapfile.c line 2783:

 if(style->_geomtransform.type != MS_GEOMTRANSFORM_NONE) {
    /*
    ** TODO: fprintf(stream, "        GEOMTRANSFORM \"%s\"\n",style->_geomtransformexpression);
    */
    /*regiodata: GEOMTRANSFORM in mapfile*/
    writeKeyword(stream, indent, "GEOMTRANSFORM", style->_geomtransform.type, 6,
      MS_GEOMTRANSFORM_BBOX, "\"bbox\"",
      MS_GEOMTRANSFORM_END, "\"end\"",
      MS_GEOMTRANSFORM_LABELPOINT, "\"labelpnt\"",
      MS_GEOMTRANSFORM_LABELPOLY, "\"labelpoly\"",
      MS_GEOMTRANSFORM_START, "\"start\"",
      MS_GEOMTRANSFORM_VERTICES, "\"vertices\""
    );
  }

  Changed 21 months ago by aboudreault

  • status changed from new to closed
  • resolution set to fixed

The styleObj properties patch backported in branch 6.0 in r12563. The patch you mentionned has also been committed in trunk (r12561) and backported as well in branch 6.0 in r12562. Things will be ok in MapServer 6.0.2.

Thanks for your tests regiodata.

  Changed 16 months ago by iap

This fix was not applied to 6.0.2 (tested with ubuntugis-unstable). Properties like GEOMTRANSFORM, GAP, LINECAP, LINEJOIN, OFFSET, PATTERN can't be set directly using styleObj.

Note: Using updateFromString method works. $styleObj->updateFromString("STYLE GAP 10 END");

  Changed 16 months ago by aboudreault

iap, sorry... you are right. the patch in 6.0 was missing the setter properties. Fixed in r13151.

Note: See TracTickets for help on using tickets.