Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#3901 closed defect (fixed)

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 (9)

comment:1 by regiodata, 13 years ago

Priority: normalhighest

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.

comment:2 by aboudreault, 13 years ago

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.

comment:3 by aboudreault, 13 years ago

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

comment:4 by aboudreault, 13 years ago

Cc: regiodata added

in reply to:  2 comment:5 by regiodata, 13 years ago

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.

comment:6 by regiodata, 13 years ago

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\""
    );
  }

comment:7 by aboudreault, 13 years ago

Resolution: fixed
Status: newclosed

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.

comment:8 by iap, 12 years ago

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");

comment:9 by aboudreault, 12 years ago

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.