The document provides an overview of the classes, properties, methods, constants, and functions available in the PHP/Mapscript module for interacting with MapServer. It includes descriptions of the ClassObj class which can be used to represent classes in a MapServer mapfile and its constructor, members like name and status, and methods like set, drawLegendIcon, and getStyle.
Structures allow the grouping of different data types together under one name. They are useful for storing records with multiple related data fields, like a student record with a name, roll number, and marks. Structures can be initialized, passed to functions by value or reference, and used to create arrays of records. Unions share the same memory location for different member types, while structures allocate separate memory for each member.
This document provides a summary of common Rails database migration methods for various database types including PostgreSQL, MySQL, SQLite, and SQL Server. It lists column types, shortcut methods for changing columns, and methods for creating, dropping, and renaming tables. Sample migration files are shown to demonstrate how to load fixture data into the database.
The document provides an overview of the Java Database Connectivity (JDBC) API. It describes key interfaces like Connection, Statement, and PreparedStatement that are used to connect to a database and execute SQL statements. It also covers ResultSet for accessing query results, and the use of transactions and savepoints for maintaining data integrity. Classes like DriverManager help establish the initial connection to access databases using JDBC.
The document discusses constructor overloading in Java using a Box class. It defines multiple constructors for the Box class that take different parameters, allowing objects to be initialized in different ways. It then defines a BoxMass subclass that inherits from Box and adds a mass property. The main method demonstrates creating BoxMass objects with different constructors and printing their volume and mass. It also discusses using a superclass reference variable to reference a subclass object, and the limitations this introduces. Finally, it covers using the super keyword in subclass constructors to call parent constructors and access hidden superclass members.
The document discusses structures and unions in C programming. It defines a structure as a user-defined data type that allows storing heterogeneous data under a single name. Structures contain members that can be accessed using the dot operator. Arrays of structures allow storing multiple records of the same type. Structures can be nested by defining a structure member within another structure. Unions allow storing different types of data in the same memory location, but only one member can be accessed at a time. Examples are provided to demonstrate defining, declaring, and accessing structure and union variables as well as nested structures.
The migrate module provides a flexible framework for migrating content into Drupal from other sources (e.g., when converting a web site from another CMS to Drupal). Out-of-the-box, support for creating core Drupal objects such as nodes, users, files, terms, and comments are included - it can easily be extended for migrating other kinds of content. The power comes from an object oriented API that's tricky to get started with - We'll walk through the various classes in the module and how they work together to manage migrations.
I am currently looking for co-presenters or to present in a panel format as I feel we can all have something to learn from each other.
UPDATE July 21, 2012: Thank you to everyone that was able to come out to the session. I know it was a complex topic. As another resource, you can take a look at the code from the example I displayed today at https://bitbucket.org/btmash/redcat_new_migration. Obviously, the migration won't work (the db needs to exist) but the code should hopefully be helpful. Cheers!
This document provides an overview of typeclasses in Haskell. It explains that typeclasses define properties that types can have, like being comparable (Eq) or ordered (Ord). Functions can constrain their parameters to only allow types that are members of certain typeclasses. The document also demonstrates how to define your own data types and derive standard typeclass instances or implement them yourself. This allows user-defined types to work with functions that require those typeclasses.
Structures allow the grouping of different data types together under one name. They are useful for storing records with multiple related data fields, like a student record with a name, roll number, and marks. Structures can be initialized, passed to functions by value or reference, and used to create arrays of records. Unions share the same memory location for different member types, while structures allocate separate memory for each member.
This document provides a summary of common Rails database migration methods for various database types including PostgreSQL, MySQL, SQLite, and SQL Server. It lists column types, shortcut methods for changing columns, and methods for creating, dropping, and renaming tables. Sample migration files are shown to demonstrate how to load fixture data into the database.
The document provides an overview of the Java Database Connectivity (JDBC) API. It describes key interfaces like Connection, Statement, and PreparedStatement that are used to connect to a database and execute SQL statements. It also covers ResultSet for accessing query results, and the use of transactions and savepoints for maintaining data integrity. Classes like DriverManager help establish the initial connection to access databases using JDBC.
The document discusses constructor overloading in Java using a Box class. It defines multiple constructors for the Box class that take different parameters, allowing objects to be initialized in different ways. It then defines a BoxMass subclass that inherits from Box and adds a mass property. The main method demonstrates creating BoxMass objects with different constructors and printing their volume and mass. It also discusses using a superclass reference variable to reference a subclass object, and the limitations this introduces. Finally, it covers using the super keyword in subclass constructors to call parent constructors and access hidden superclass members.
The document discusses structures and unions in C programming. It defines a structure as a user-defined data type that allows storing heterogeneous data under a single name. Structures contain members that can be accessed using the dot operator. Arrays of structures allow storing multiple records of the same type. Structures can be nested by defining a structure member within another structure. Unions allow storing different types of data in the same memory location, but only one member can be accessed at a time. Examples are provided to demonstrate defining, declaring, and accessing structure and union variables as well as nested structures.
The migrate module provides a flexible framework for migrating content into Drupal from other sources (e.g., when converting a web site from another CMS to Drupal). Out-of-the-box, support for creating core Drupal objects such as nodes, users, files, terms, and comments are included - it can easily be extended for migrating other kinds of content. The power comes from an object oriented API that's tricky to get started with - We'll walk through the various classes in the module and how they work together to manage migrations.
I am currently looking for co-presenters or to present in a panel format as I feel we can all have something to learn from each other.
UPDATE July 21, 2012: Thank you to everyone that was able to come out to the session. I know it was a complex topic. As another resource, you can take a look at the code from the example I displayed today at https://bitbucket.org/btmash/redcat_new_migration. Obviously, the migration won't work (the db needs to exist) but the code should hopefully be helpful. Cheers!
This document provides an overview of typeclasses in Haskell. It explains that typeclasses define properties that types can have, like being comparable (Eq) or ordered (Ord). Functions can constrain their parameters to only allow types that are members of certain typeclasses. The document also demonstrates how to define your own data types and derive standard typeclass instances or implement them yourself. This allows user-defined types to work with functions that require those typeclasses.
Data Mining Extensions (DMX) is a query language used to create, manage, and query data mining models. DMX was introduced in 1999 to define common concepts for data mining. It includes objects like mining structures and models. Mining structures define columns and hold cached data, while models perform machine learning on structures. DMX statements are used for creation, prediction, and training. Prediction joins apply model patterns to data to estimate unknown values.
The document provides information about Structured Query Language (SQL) including its basic concepts, data types, CREATE TABLE and INSERT commands, constraints, operators and data modifications. It defines key SQL concepts such as relations, attributes, tuples, primary keys, foreign keys and discusses SQL's capabilities for data definition, manipulation, queries and transaction control. Examples are given for creating a table and inserting records into the table.
This document contains notes on JavaScript functions from a course. It discusses:
1) Functions allow breaking programs into modules for easier maintenance and debugging. Functions in JavaScript include predefined and programmer-defined methods.
2) Functions receive arguments, can call other functions in a hierarchical relationship, and may return values. Functions define local variables that do not exist outside the function.
3) Examples show defining and calling functions to square numbers, find the maximum of three values, and generate random numbers by scaling and shifting the output of Math.random().
The document discusses PHP, including introducing PHP and its basic syntax, data types, operators, arrays, and array manipulation. Key points covered include:
- PHP is a popular server-side scripting language that is free and open-source
- PHP code is enclosed within <?php ?> tags
- Variables start with $, types include integers, strings, arrays
- Operators like +, -, *, / can be used, and arrays store multiple elements that can be accessed by index
- Arrays can be created and values assigned in different ways, then iterated through to output elements
This document describes a method for dynamically generating a customized data entry DataWindow in PowerBuilder. Individual DataWindows can have fields marked as required or recommended by the user. This method extracts those fields from multiple source DataWindows, and consolidates them into a single runtime-generated DataWindow for new record entry. It addresses issues like data types, initial values, and edit masks when merging fields from different sources. The process involves selecting the relevant fields, generating the DataWindow syntax, setting properties, and formatting the final DataWindow. This allows presenting the user only the necessary fields for a new record from various sources.
This document defines SQL data definition statements and basic SQL query structure. It discusses DDL statements like CREATE, ALTER, and DROP that are used to define and manage database structures. It also explains the typical components of an SQL query including the SELECT, FROM, and WHERE clauses. Finally, it outlines several set operations in SQL like UNION, UNION ALL, INTERSECT, and MINUS.
A class is a code template for creating objects. Objects have member variables and have behaviour associated with them. In python a class is created by the keyword class.
An object is created using the constructor of the class. This object will then be called the instance of the class.
This document provides an introduction and overview of key JavaScript concepts including data types, variables, objects, functions, and arrays. It discusses JavaScript's case sensitivity, optional semicolons, and comment syntax. It also covers numeric, string, boolean, and null/undefined data types as well as objects, functions, and arrays. Special values, operators, and methods are defined for working with each data type.
This document summarizes a talk about using the Scalaz library in real-world Scala applications. It begins by acknowledging common criticisms of Scalaz as being too complex or not immediately useful. It then provides examples of how the speaker's company uses Scalaz for tasks like JSON mapping and handling state. The speaker advocates using Scalaz intentionally and delineating pure and impure code. They discuss strategies for learning Scalaz incrementally and as a team. The document argues that with pragmatic use, Scalaz can make code more modular, testable and help reason about concurrency without adding undue complexity.
This document provides a PHP 5 cheat sheet that summarizes key PHP types, functions, and predefined variables. It covers boolean, integer, and string types; arrays; classes; date/time functions; and the $_SERVER and $_FILES predefined variables. For each section, it lists main elements and functions with brief descriptions.
This document provides an overview and goals for a book on advanced SQL tips and tricks. It discusses topics covered in the book such as scalar functions, analytic functions, complex subqueries, common table expressions, and XML tricks. The document also provides examples of SQL code snippets demonstrating various techniques, including finding values containing percentages, combining values into a single row, correlating vs simple subqueries, and using common table expressions.
String Function
1. charAt():
This method returns the character from the specified index.Characters in a string are indexed from left to right. The index of the first character is 0, and the index of the last character in a string called stringName is stringName.length - 1.
Syntax:
string.charAt(index);
Return Value:
Returns the character from the specified index.
Example:
<html>
<head>
<title>JavaScript String charAt() Method</title>
</head>
<body>
</body>
</html>
Output:
str.charAt(0) is:T
2. concat():
Description:
This method adds two or more strings and returns a new single string.
Syntax:
string.concat(string2, string3[, ..., stringN]);
parameters:
string2...stringN : These are the strings to be concatenated.
Return Value:
Returns a single concatenated string.
Example:
<html>
<head>
<title>JavaScript String concat() Method</title>
</head>
<body>
</body>
</html>
Output:
Concatenated String :This is string oneThis is string two.
3. indexOf():
Description:
This method returns the index within the calling String object of the first occurrence of the specified value, starting the search at fromIndex or -1 if the value is not found.
Syntax:
string.indexOf(searchValue[, fromIndex])
Parameters:
searchValue : A string representing the value to search for.
fromIndex : The location within the calling string to start the search from. It can be any integer between 0 and the length of the string. The default value is 0.
Return Value:
Returns the index of the found occurrence otherwise -1 if not found.
Example:
<html>
<head>
<title>JavaScript String indexOf() Method</title>
</head>
<body>
<br />");
var index = str1.indexOf( "one" );
document.write("indexOf found String :" + index );
</body></html>
Oputput:
indexOf found String :8
indexOf found String :15
4. lastIndexOf():
Description:
This method returns the index within the calling String object of the last occurrence of the specified value, starting the search at fromIndex or -1 if the value is not found.
Syntax:
string.lastIndexOf(searchValue[, fromIndex])
Parameters:
searchValue : A string representing the value to search for.
fromIndex : The location within the calling string to start the search from. It can be any integer between 0 and the length of the string. The default value is 0.
Return Value:
Returns the index of the last found occurrence otherwise -1 if not found.
Example:
<html>
<head>
<title>JavaScri
The document discusses various aspects of using arrays in programming, including:
- Defining single and multidimensional arrays using Dim statements
- Referencing individual array elements using subscripts
- Traversing array elements using For Each loops
- Storing related data in structures that can include array elements
- Using arrays to accumulate totals and perform table lookups
SQL is a programming language used to manage data in relational database systems. It can be used to create, query, update, and modify relational databases. SQL comprises both data definition and data manipulation languages that allow users to define and modify database schemas as well as store, retrieve, and manage data within databases. Some key advantages of SQL include high speed for retrieving large amounts of data, adherence to well-defined standards, and not requiring coding to manage database systems.
The document discusses different JavaScript data types including:
- HTMLString - A string used to represent DOM elements
- Number - Numeric values including parsing, NaN, Infinity
- Object - All values in JavaScript are objects that can have properties accessed via dot or bracket notation
- Array - Mutable lists that can be accessed and modified with index notation
- PlainObject - Distinct from other object types, a plain object is a collection of key-value pairs identified by jQuery's isPlainObject method
MySQL is a popular and freely available open-source relational database management system (RDBMS). It stores data in tables and relationships between data are also stored in tables. MySQL uses SQL and works on many operating systems. It has commands for data definition (CREATE, ALTER, DROP), data manipulation (SELECT, INSERT, UPDATE, DELETE), transaction control (COMMIT, ROLLBACK), and data access control (GRANT, REVOKE). Joins allow retrieving data from multiple tables by linking rows together. Common join types are inner joins, outer joins, and self joins.
This document provides documentation on how to configure and customize the Wayfinder and Breadcrumbs snippets in MODx. It describes the various parameters that can be set for each snippet to control things like which templates are used, CSS classes, which fields are displayed, and more. Templates, placeholders, and general processing order are also outlined to help developers customize the output.
The document discusses modeling and the Unified Modeling Language (UML). It defines what a model and UML are, and explains the basic building blocks of UML including things, relationships, and diagrams. It provides examples of structural things like classes, interfaces, and components in UML as well as behavioral things like interactions and state machines. The document also gives examples of common UML diagrams and relationships between classes.
This document provides an introduction to creating and using classes in C#. Key points covered include defining classes with fields, methods, and constructors; using accessibility modifiers like public and private; calling methods and using the this keyword; creating static methods; and using listboxes, comboboxes, and events for selection changes. Examples are provided for defining classes, constructors, static and instance methods, and populating and accessing selection properties of list and combo boxes.
El documento explica cómo configurar un repositorio remoto en GitHub para trabajar con proyectos de código. Primero, se crea una cuenta en GitHub y un nuevo proyecto, anotando la URL del repositorio. Luego, se usa Git para vincular el repositorio local con el remoto usando 'git remote add' y la URL, y para subir ('git push') y descargar ('git pull') código entre los dos repositorios. Finalmente, se incluyen enlaces a cursos sobre Git.
Data Mining Extensions (DMX) is a query language used to create, manage, and query data mining models. DMX was introduced in 1999 to define common concepts for data mining. It includes objects like mining structures and models. Mining structures define columns and hold cached data, while models perform machine learning on structures. DMX statements are used for creation, prediction, and training. Prediction joins apply model patterns to data to estimate unknown values.
The document provides information about Structured Query Language (SQL) including its basic concepts, data types, CREATE TABLE and INSERT commands, constraints, operators and data modifications. It defines key SQL concepts such as relations, attributes, tuples, primary keys, foreign keys and discusses SQL's capabilities for data definition, manipulation, queries and transaction control. Examples are given for creating a table and inserting records into the table.
This document contains notes on JavaScript functions from a course. It discusses:
1) Functions allow breaking programs into modules for easier maintenance and debugging. Functions in JavaScript include predefined and programmer-defined methods.
2) Functions receive arguments, can call other functions in a hierarchical relationship, and may return values. Functions define local variables that do not exist outside the function.
3) Examples show defining and calling functions to square numbers, find the maximum of three values, and generate random numbers by scaling and shifting the output of Math.random().
The document discusses PHP, including introducing PHP and its basic syntax, data types, operators, arrays, and array manipulation. Key points covered include:
- PHP is a popular server-side scripting language that is free and open-source
- PHP code is enclosed within <?php ?> tags
- Variables start with $, types include integers, strings, arrays
- Operators like +, -, *, / can be used, and arrays store multiple elements that can be accessed by index
- Arrays can be created and values assigned in different ways, then iterated through to output elements
This document describes a method for dynamically generating a customized data entry DataWindow in PowerBuilder. Individual DataWindows can have fields marked as required or recommended by the user. This method extracts those fields from multiple source DataWindows, and consolidates them into a single runtime-generated DataWindow for new record entry. It addresses issues like data types, initial values, and edit masks when merging fields from different sources. The process involves selecting the relevant fields, generating the DataWindow syntax, setting properties, and formatting the final DataWindow. This allows presenting the user only the necessary fields for a new record from various sources.
This document defines SQL data definition statements and basic SQL query structure. It discusses DDL statements like CREATE, ALTER, and DROP that are used to define and manage database structures. It also explains the typical components of an SQL query including the SELECT, FROM, and WHERE clauses. Finally, it outlines several set operations in SQL like UNION, UNION ALL, INTERSECT, and MINUS.
A class is a code template for creating objects. Objects have member variables and have behaviour associated with them. In python a class is created by the keyword class.
An object is created using the constructor of the class. This object will then be called the instance of the class.
This document provides an introduction and overview of key JavaScript concepts including data types, variables, objects, functions, and arrays. It discusses JavaScript's case sensitivity, optional semicolons, and comment syntax. It also covers numeric, string, boolean, and null/undefined data types as well as objects, functions, and arrays. Special values, operators, and methods are defined for working with each data type.
This document summarizes a talk about using the Scalaz library in real-world Scala applications. It begins by acknowledging common criticisms of Scalaz as being too complex or not immediately useful. It then provides examples of how the speaker's company uses Scalaz for tasks like JSON mapping and handling state. The speaker advocates using Scalaz intentionally and delineating pure and impure code. They discuss strategies for learning Scalaz incrementally and as a team. The document argues that with pragmatic use, Scalaz can make code more modular, testable and help reason about concurrency without adding undue complexity.
This document provides a PHP 5 cheat sheet that summarizes key PHP types, functions, and predefined variables. It covers boolean, integer, and string types; arrays; classes; date/time functions; and the $_SERVER and $_FILES predefined variables. For each section, it lists main elements and functions with brief descriptions.
This document provides an overview and goals for a book on advanced SQL tips and tricks. It discusses topics covered in the book such as scalar functions, analytic functions, complex subqueries, common table expressions, and XML tricks. The document also provides examples of SQL code snippets demonstrating various techniques, including finding values containing percentages, combining values into a single row, correlating vs simple subqueries, and using common table expressions.
String Function
1. charAt():
This method returns the character from the specified index.Characters in a string are indexed from left to right. The index of the first character is 0, and the index of the last character in a string called stringName is stringName.length - 1.
Syntax:
string.charAt(index);
Return Value:
Returns the character from the specified index.
Example:
<html>
<head>
<title>JavaScript String charAt() Method</title>
</head>
<body>
</body>
</html>
Output:
str.charAt(0) is:T
2. concat():
Description:
This method adds two or more strings and returns a new single string.
Syntax:
string.concat(string2, string3[, ..., stringN]);
parameters:
string2...stringN : These are the strings to be concatenated.
Return Value:
Returns a single concatenated string.
Example:
<html>
<head>
<title>JavaScript String concat() Method</title>
</head>
<body>
</body>
</html>
Output:
Concatenated String :This is string oneThis is string two.
3. indexOf():
Description:
This method returns the index within the calling String object of the first occurrence of the specified value, starting the search at fromIndex or -1 if the value is not found.
Syntax:
string.indexOf(searchValue[, fromIndex])
Parameters:
searchValue : A string representing the value to search for.
fromIndex : The location within the calling string to start the search from. It can be any integer between 0 and the length of the string. The default value is 0.
Return Value:
Returns the index of the found occurrence otherwise -1 if not found.
Example:
<html>
<head>
<title>JavaScript String indexOf() Method</title>
</head>
<body>
<br />");
var index = str1.indexOf( "one" );
document.write("indexOf found String :" + index );
</body></html>
Oputput:
indexOf found String :8
indexOf found String :15
4. lastIndexOf():
Description:
This method returns the index within the calling String object of the last occurrence of the specified value, starting the search at fromIndex or -1 if the value is not found.
Syntax:
string.lastIndexOf(searchValue[, fromIndex])
Parameters:
searchValue : A string representing the value to search for.
fromIndex : The location within the calling string to start the search from. It can be any integer between 0 and the length of the string. The default value is 0.
Return Value:
Returns the index of the last found occurrence otherwise -1 if not found.
Example:
<html>
<head>
<title>JavaScri
The document discusses various aspects of using arrays in programming, including:
- Defining single and multidimensional arrays using Dim statements
- Referencing individual array elements using subscripts
- Traversing array elements using For Each loops
- Storing related data in structures that can include array elements
- Using arrays to accumulate totals and perform table lookups
SQL is a programming language used to manage data in relational database systems. It can be used to create, query, update, and modify relational databases. SQL comprises both data definition and data manipulation languages that allow users to define and modify database schemas as well as store, retrieve, and manage data within databases. Some key advantages of SQL include high speed for retrieving large amounts of data, adherence to well-defined standards, and not requiring coding to manage database systems.
The document discusses different JavaScript data types including:
- HTMLString - A string used to represent DOM elements
- Number - Numeric values including parsing, NaN, Infinity
- Object - All values in JavaScript are objects that can have properties accessed via dot or bracket notation
- Array - Mutable lists that can be accessed and modified with index notation
- PlainObject - Distinct from other object types, a plain object is a collection of key-value pairs identified by jQuery's isPlainObject method
MySQL is a popular and freely available open-source relational database management system (RDBMS). It stores data in tables and relationships between data are also stored in tables. MySQL uses SQL and works on many operating systems. It has commands for data definition (CREATE, ALTER, DROP), data manipulation (SELECT, INSERT, UPDATE, DELETE), transaction control (COMMIT, ROLLBACK), and data access control (GRANT, REVOKE). Joins allow retrieving data from multiple tables by linking rows together. Common join types are inner joins, outer joins, and self joins.
This document provides documentation on how to configure and customize the Wayfinder and Breadcrumbs snippets in MODx. It describes the various parameters that can be set for each snippet to control things like which templates are used, CSS classes, which fields are displayed, and more. Templates, placeholders, and general processing order are also outlined to help developers customize the output.
The document discusses modeling and the Unified Modeling Language (UML). It defines what a model and UML are, and explains the basic building blocks of UML including things, relationships, and diagrams. It provides examples of structural things like classes, interfaces, and components in UML as well as behavioral things like interactions and state machines. The document also gives examples of common UML diagrams and relationships between classes.
This document provides an introduction to creating and using classes in C#. Key points covered include defining classes with fields, methods, and constructors; using accessibility modifiers like public and private; calling methods and using the this keyword; creating static methods; and using listboxes, comboboxes, and events for selection changes. Examples are provided for defining classes, constructors, static and instance methods, and populating and accessing selection properties of list and combo boxes.
El documento explica cómo configurar un repositorio remoto en GitHub para trabajar con proyectos de código. Primero, se crea una cuenta en GitHub y un nuevo proyecto, anotando la URL del repositorio. Luego, se usa Git para vincular el repositorio local con el remoto usando 'git remote add' y la URL, y para subir ('git push') y descargar ('git pull') código entre los dos repositorios. Finalmente, se incluyen enlaces a cursos sobre Git.
This document provides documentation for MapServer version 5.4.2. It includes sections on an introduction to MapServer, installing MapServer on Unix and Windows systems, a MapServer tutorial, and details on Mapfile configuration including layers, styles, symbols and other elements. The document aims to help users get started with MapServer and configure map projects.
2010 carbohydrate for weight and metabolic control- where do we standAgrin Life
This document reviews the evidence on carbohydrate intake for weight and metabolic control. It discusses how recommendations have generally advocated high carbohydrate intake but the prevalence of obesity and diabetes has still increased. Recent evidence suggests diets lower in carbohydrates and higher in unsaturated fats or protein may facilitate weight loss and improve health markers independent of weight loss. The document concludes that future studies are still needed to determine if diets with a more balanced macronutrient composition than currently recommended could better support weight and metabolic health.
2010 inhibition of suicidal erythrocyte death by vitamin cAgrin Life
1) The study investigated whether vitamin C can inhibit suicidal death of erythrocytes, similar to how it inhibits apoptosis in nucleated cells.
2) Experiments showed that energy depletion, oxidative stress, and cell shrinkage triggered suicidal erythrocyte death, as evidenced by increased cytosolic calcium levels, decreased cell volume, and increased phosphatidylserine exposure on the cell surface.
3) Vitamin C did not affect erythrocytes under normal conditions but significantly attenuated the suicidal erythrocyte death triggered by energy depletion, oxidative stress, and cell shrinkage by reducing cytosolic calcium levels and phosphatidylserine exposure.
2007 overexpression of an r1 r2r3 myb gene, osmyb3r-2,Agrin Life
Overexpression of the rice gene OsMYB3R-2, which encodes an R1R2R3 MYB transcription factor, increases tolerance to freezing, drought, and salt stress in transgenic Arabidopsis plants. OsMYB3R-2 expression is induced by cold, drought, and salt stress. Transgenic Arabidopsis plants overexpressing OsMYB3R-2 showed increased tolerance to these stresses compared to wild-type plants. The overexpression also led to higher expression of several cold-related genes. This suggests that OsMYB3R-2 acts as a master switch that increases stress tolerance.
Git es un software de control de versiones que registra los cambios en archivos de código fuente u otros archivos de un proyecto, permitiendo almacenar el historial de versiones del software. Proporciona comandos para configurar el nombre y correo del desarrollador, iniciar el monitoreo de un proyecto, verificar el estado de los archivos, agregar cambios, realizar commits, ver el historial, cambiar entre versiones y ramas, y clonar repositorios.
Stata cheat sheet: programming. Co-authored with Tim Essam (linkedin.com/in/timessam). See all cheat sheets at http://bit.ly/statacheatsheets. Updated 2016/06/04
Lab 2: Classification and Regression Prediction Models, training and testing ...Yao Yao
https://github.com/yaowser/data_mining_group_project
https://www.kaggle.com/c/zillow-prize-1/data
From the Zillow real estate data set of properties in the southern California area, conduct the following data cleaning, data analysis, predictive analysis, and machine learning algorithms:
Lab 2: Classification and Regression Prediction Models, training and testing splits, optimization of K Nearest Neighbors (KD tree), optimization of Random Forest, optimization of Naive Bayes (Gaussian), advantages and model comparisons, feature importance, Feature ranking with recursive feature elimination, Two dimensional Linear Discriminant Analysis
This document provides a summary of programming commands and techniques in Stata. It discusses loops, macros, scalars, matrices, and accessing estimation results. Key commands covered include foreach, forvalues, levelsof, return, ereturn, estimates, matrix, scalar, global. The document is intended as a cheat sheet for common Stata programming tasks.
The document contains a list of 37 PHP interview questions and their answers. Some of the key questions covered include: how to find the number of days between two dates in PHP, how to define a constant, the difference between urlencode and urldecode, how to get uploaded file information, the difference between mysql_fetch_object and mysql_fetch_array, how to pass a variable by reference, how to submit a form without a submit button, how to extract a string from another string using a regular expression, and how to get browser properties using PHP.
This document introduces the design of an object-oriented rendering architecture for a production renderer. It discusses the hierarchical graphics state system, including stacks that manage modes, options, attributes, transformations, and objects/lights. These stacks allow nested blocks and retain state as primitives are added to the scene. The document also outlines key classes like State, Options, Attributes, and Transform that implement the architecture and interfaces.
This document provides an overview of data structures and algorithms. It introduces common linear data structures like stacks, queues, and linked lists. It discusses the need for abstract data types and different data types. It also covers implementing stacks as a linked list and common stack operations. Key applications of stacks include function call stacks which use a LIFO structure to remember the order of function calls and returns.
This document discusses Python database programming. It introduces databases and how they store data in tables connected through columns. It discusses SQL for creating, accessing, and manipulating database data. It then discusses how Python supports various databases and database operations. It covers the Python DB-API for providing a standard interface for database programming. It provides examples of connecting to a database, executing queries, and retrieving and inserting data.
Task Perform addition subtraction division and multiplic.pdfacsmadurai
Task: Perform addition, subtraction, division, and multiplication, of rational numbers on MIPS Mars
Programming Simulator by writing a code and print the answers (using macros) from the pictures
provided. Also, when you write the code make sure you follow this format,
format:
.macro print_int (%x)
li $v0, 1
add $a0, $zero, %x
syscall
.end_macro
print_int ($s0)
print_int (10)
Intro Settings Syscalls IDE Debugging Command Tools History Limitations Exception Handlers
Macros Acknowledgements MARS home Writing and Using Macros .macro, .end_macro,.eqv and
.include directives are new in MARS 4.3 Introduction to macros Patterson and Hennessy define a
macro as a pattern-matching and replacement facility that provides a simple mechanism to name
a frequently used sequence of instructions [1]. This permits the programmer to specify the
instruction sequence by invoking the macro. This requires only one line of code for each use
instead of repeatedly typing in the instruction sequence each time. It follows the axiom "define
once, use many times," which not only reduces the chance for error but also facilitates program
maintenance. Macros are like procedures (subroutines) in this sense but operate differently than
procedures. Procedures in MIPS assembly language follow particular protocols for procedure
definition, call and return. Macros operate by substituting the macro body for each use at the time
of assembly. This substitution is called macro expansion.. They do not require the protocols and
execution overhead of procedures. As a simple example, you may want to terminate your program
from a number of locations. If you are running from the MARS IDE, you will use system call 10,
exit. The instruction sequence is pretty easy 1i$v0,10syscal1 but still tedious. You can define a
macro, let's call it done, to represent this sequence [ begin{array}{l} text { macro done } text { i1 } $
text { vo, } 10 text { syscali } text { +end_macro } end{array} ] then invoke it whenever you wish
with the statement done At assembly time, the assembler will replace each occurrence of the
statement done with the two-statement sequence 1i$v0,10syscali This is the macro expansion.
The runtime simulator is unaware of macros or macro expansion. If running MARS from the
command line, perhaps you want to return a termination value. This can be done with syscall 17,
exit2, which takes the termination value as an argument. An equivalent macro, let's call it
terminate would be macro terminate (stermination_value) ii $a0, itermination_value li $v0,17
syscali .end_macro This macro defines a formal parameter to represent the termination value. You
would invoke it with the statement terminate (1) to terminate with value 1. Upon assembly, the
statement terminate (1) would be replaced byterninate (1) to terminate with value 1. Upon
assembly, the statement terainate (1) would be replaced by the three-statement sequence The
argument value, 1, is substituted wherever the formal parameter teermi.
Need help coding MorseCode in JavaCreate Class MorseCodeClient. T.pdffastechsrv
Need help coding MorseCode in Java:
Create Class MorseCodeClient. This represents a Client that allows a user communicate with a
server across a network. The server saves the message and then relays the message to another
client This is a JFrame application and should extend JFrame and Implement Runnable. The
client application should allow the user to type English-language phrases in a JTextArea. When
the user sends the message, the client application encodes the text into Morse code and sends the
coded message through the server to the other client. Create class MorseCodeClientTest, this is a
test class for morse code client and uses the main method to created new instance of
MorseCodeClient.
Solution
package MorseCode;
import java.util.ArrayList;
public class MorseCodeConverter extends javax.swing.JFrame {
/**
* Creates new form MorseCodeConverter
*/
public MorseCodeConverter() {
initComponents();
}
@SuppressWarnings(\"unchecked\")
// //GEN-BEGIN:initComponents
private void initComponents() {
mainWindowContainer = new javax.swing.JPanel();
userSentence = new javax.swing.JTextField();
inputLabel = new javax.swing.JLabel();
outputLabel = new javax.swing.JLabel();
inputConfirmButton = new javax.swing.JButton();
outputField = new javax.swing.JTextField();
title = new javax.swing.JLabel();
javax.swing.GroupLayout mainWindowContainerLayout = new
javax.swing.GroupLayout(mainWindowContainer);
mainWindowContainer.setLayout(mainWindowContainerLayout);
mainWindowContainerLayout.setHorizontalGroup(
mainWindowContainerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEAD
ING)
.addGap(0, 100, Short.MAX_VALUE)
);
mainWindowContainerLayout.setVerticalGroup(
mainWindowContainerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEAD
ING)
.addGap(0, 100, Short.MAX_VALUE)
);
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setBackground(new java.awt.Color(204, 204, 255));
userSentence.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
userSentenceActionPerformed(evt);
}
});
inputLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
inputLabel.setText(\"Enter your sentence here\");
outputLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
outputLabel.setText(\"This is your sentence in Morse Code\");
outputLabel.setToolTipText(\"\");
inputConfirmButton.setText(\"OK\");
inputConfirmButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
inputConfirmButtonActionPerformed(evt);
}
});
outputField.setFont(new java.awt.Font(\"Tahoma\", 0, 16)); // NOI18N
title.setFont(new java.awt.Font(\"Simplified Arabic\", 0, 18)); // NOI18N
title.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
title.setText(\"Morse Code Converter\");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGrou.
The document provides an interview questions and answers guide for C programming language. It includes questions on topics such as the definition of C language, differences between functions like printf and sprintf, static variables, unions, linked lists, storage classes in C, and hashing. For each question, it provides multiple detailed answers explaining concepts in C programming such as memory allocation, strings, pointers, macros and more.
This document discusses different ways to create macro variables from within a DATA step in SAS. It describes using the SYMPUT routine to assign values from DATA step variables or expressions to macro variables. Multiple macro variables can be created in a single DATA step using SYMPUT with expressions for both the macro variable name and value. Indirect referencing of macro variables allows their values to be resolved at a later time.
Java 8 was released in 2014 and introduced several new features including lambda expressions, functional interfaces, method references, and default methods in interfaces. It also included a new Stream API for functional-style data processing, a date/time API, and Project Nashorn for embedding JavaScript in Java applications. Future versions like Java 9 will focus on modularity, new APIs, and further improvements.
The document describes the MLbase stack, which aims to make machine learning development and use easier and more scalable. It discusses three levels of the stack: MLlib for low-level ML functionality, MLI which provides higher-level abstractions and feature extraction tools, and ML Optimizer which automates model selection. Examples are given showing how text classification can be done more easily using MLI compared to directly with MLlib. The goal is to release initial functionality in the summer and expand it over the following winter.
This document provides an overview of SAS macros, including:
1) The purpose of the SAS macro facility is to allow for dynamic and self-modifying SAS programs through the use of special programs called macros that can generate tailored SAS code.
2) There are two types of macro variables - automatic variables created by SAS and user-defined variables created within the SAS program.
3) Macro variables can be created using %LET, CALL SYMPUT, and the INTO clause and can be either global or local in scope.
- Apply functions in R are used to apply a specified function to each column or row of R objects. Common apply functions include apply(), lapply(), sapply(), tapply(), vapply(), and mapply().
- The dplyr package is a powerful R package for data manipulation. It provides verbs like select(), filter(), arrange(), mutate(), and summarize() to work with tabular data.
- Functions like apply(), lapply(), sapply() apply a function over lists or matrices. Arrange() reorders data, mutate() adds new variables, and summarize() collapses multiple values into single values.
21.- Creating virtual species and calculating simple ensemble models with R ...modestrsoftware
In this tutorial we describe two simple scripts in R to generate random virtual species, and to calculate species distribution models (SDM's) using ensemble models.
Those scripts may be useful to test hypotesis, or to work with ModestR or other tools
This article describes the functionality within Schema Studio which allows a user to establish the landscape of dependent types for a selected top-level type in a Schema.
The document discusses an R programming module that will cover getting started with R, data types and structures, control flow and functions, and scalability. It compares R to MATLAB and Python, describing their similarities as interactive shells for data manipulation but noting differences in popularity across fields and open-source availability. Base graphics and ggplot2 for data visualization are introduced. Sample datasets are also mentioned.
This lesson covers SAS macros including how they work, creating macros and macro variables, and incorporating macros into existing programs. Key points include macros allow writing a program that generates a program, macros help automate repetitive tasks, and macro variables store text strings that can be referenced throughout a SAS program. The lesson also reviews invoking macros, using parameters, and conditional logic with %IF/%THEN/%ELSE.
The document discusses object-oriented programming in Python. It defines key OOP concepts like classes, objects, and methods. It provides examples of defining classes and methods in Python. It also covers inheritance, polymorphism, and data abstraction in OOP. Database programming in Python is also discussed, including connecting to databases and performing CRUD operations using the Python DB API.
Discover top-tier mobile app development services, offering innovative solutions for iOS and Android. Enhance your business with custom, user-friendly mobile applications.
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...Jason Yip
The typical problem in product engineering is not bad strategy, so much as “no strategy”. This leads to confusion, lack of motivation, and incoherent action. The next time you look for a strategy and find an empty space, instead of waiting for it to be filled, I will show you how to fill it in yourself. If you’re wrong, it forces a correction. If you’re right, it helps create focus. I’ll share how I’ve approached this in the past, both what works and lessons for what didn’t work so well.
The Microsoft 365 Migration Tutorial For Beginner.pptxoperationspcvita
This presentation will help you understand the power of Microsoft 365. However, we have mentioned every productivity app included in Office 365. Additionally, we have suggested the migration situation related to Office 365 and how we can help you.
You can also read: https://www.systoolsgroup.com/updates/office-365-tenant-to-tenant-migration-step-by-step-complete-guide/
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor IvaniukFwdays
At this talk we will discuss DDoS protection tools and best practices, discuss network architectures and what AWS has to offer. Also, we will look into one of the largest DDoS attacks on Ukrainian infrastructure that happened in February 2022. We'll see, what techniques helped to keep the web resources available for Ukrainians and how AWS improved DDoS protection for all customers based on Ukraine experience
The Department of Veteran Affairs (VA) invited Taylor Paschal, Knowledge & Information Management Consultant at Enterprise Knowledge, to speak at a Knowledge Management Lunch and Learn hosted on June 12, 2024. All Office of Administration staff were invited to attend and received professional development credit for participating in the voluntary event.
The objectives of the Lunch and Learn presentation were to:
- Review what KM ‘is’ and ‘isn’t’
- Understand the value of KM and the benefits of engaging
- Define and reflect on your “what’s in it for me?”
- Share actionable ways you can participate in Knowledge - - Capture & Transfer
Northern Engraving | Nameplate Manufacturing Process - 2024Northern Engraving
Manufacturing custom quality metal nameplates and badges involves several standard operations. Processes include sheet prep, lithography, screening, coating, punch press and inspection. All decoration is completed in the flat sheet with adhesive and tooling operations following. The possibilities for creating unique durable nameplates are endless. How will you create your brand identity? We can help!
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsDianaGray10
Join us to learn how UiPath Apps can directly and easily interact with prebuilt connectors via Integration Service--including Salesforce, ServiceNow, Open GenAI, and more.
The best part is you can achieve this without building a custom workflow! Say goodbye to the hassle of using separate automations to call APIs. By seamlessly integrating within App Studio, you can now easily streamline your workflow, while gaining direct access to our Connector Catalog of popular applications.
We’ll discuss and demo the benefits of UiPath Apps and connectors including:
Creating a compelling user experience for any software, without the limitations of APIs.
Accelerating the app creation process, saving time and effort
Enjoying high-performance CRUD (create, read, update, delete) operations, for
seamless data management.
Speakers:
Russell Alfeche, Technology Leader, RPA at qBotic and UiPath MVP
Charlie Greenberg, host
In the realm of cybersecurity, offensive security practices act as a critical shield. By simulating real-world attacks in a controlled environment, these techniques expose vulnerabilities before malicious actors can exploit them. This proactive approach allows manufacturers to identify and fix weaknesses, significantly enhancing system security.
This presentation delves into the development of a system designed to mimic Galileo's Open Service signal using software-defined radio (SDR) technology. We'll begin with a foundational overview of both Global Navigation Satellite Systems (GNSS) and the intricacies of digital signal processing.
The presentation culminates in a live demonstration. We'll showcase the manipulation of Galileo's Open Service pilot signal, simulating an attack on various software and hardware systems. This practical demonstration serves to highlight the potential consequences of unaddressed vulnerabilities, emphasizing the importance of offensive security practices in safeguarding critical infrastructure.
For the full video of this presentation, please visit: https://www.edge-ai-vision.com/2024/06/temporal-event-neural-networks-a-more-efficient-alternative-to-the-transformer-a-presentation-from-brainchip/
Chris Jones, Director of Product Management at BrainChip , presents the “Temporal Event Neural Networks: A More Efficient Alternative to the Transformer” tutorial at the May 2024 Embedded Vision Summit.
The expansion of AI services necessitates enhanced computational capabilities on edge devices. Temporal Event Neural Networks (TENNs), developed by BrainChip, represent a novel and highly efficient state-space network. TENNs demonstrate exceptional proficiency in handling multi-dimensional streaming data, facilitating advancements in object detection, action recognition, speech enhancement and language model/sequence generation. Through the utilization of polynomial-based continuous convolutions, TENNs streamline models, expedite training processes and significantly diminish memory requirements, achieving notable reductions of up to 50x in parameters and 5,000x in energy consumption compared to prevailing methodologies like transformers.
Integration with BrainChip’s Akida neuromorphic hardware IP further enhances TENNs’ capabilities, enabling the realization of highly capable, portable and passively cooled edge devices. This presentation delves into the technical innovations underlying TENNs, presents real-world benchmarks, and elucidates how this cutting-edge approach is positioned to revolutionize edge AI across diverse applications.
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...DanBrown980551
This LF Energy webinar took place June 20, 2024. It featured:
-Alex Thornton, LF Energy
-Hallie Cramer, Google
-Daniel Roesler, UtilityAPI
-Henry Richardson, WattTime
In response to the urgency and scale required to effectively address climate change, open source solutions offer significant potential for driving innovation and progress. Currently, there is a growing demand for standardization and interoperability in energy data and modeling. Open source standards and specifications within the energy sector can also alleviate challenges associated with data fragmentation, transparency, and accessibility. At the same time, it is crucial to consider privacy and security concerns throughout the development of open source platforms.
This webinar will delve into the motivations behind establishing LF Energy’s Carbon Data Specification Consortium. It will provide an overview of the draft specifications and the ongoing progress made by the respective working groups.
Three primary specifications will be discussed:
-Discovery and client registration, emphasizing transparent processes and secure and private access
-Customer data, centering around customer tariffs, bills, energy usage, and full consumption disclosure
-Power systems data, focusing on grid data, inclusive of transmission and distribution networks, generation, intergrid power flows, and market settlement data
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyScyllaDB
Freshworks creates AI-boosted business software that helps employees work more efficiently and effectively. Managing data across multiple RDBMS and NoSQL databases was already a challenge at their current scale. To prepare for 10X growth, they knew it was time to rethink their database strategy. Learn how they architected a solution that would simplify scaling while keeping costs under control.
Essentials of Automations: Exploring Attributes & Automation ParametersSafe Software
Building automations in FME Flow can save time, money, and help businesses scale by eliminating data silos and providing data to stakeholders in real-time. One essential component to orchestrating complex automations is the use of attributes & automation parameters (both formerly known as “keys”). In fact, it’s unlikely you’ll ever build an Automation without using these components, but what exactly are they?
Attributes & automation parameters enable the automation author to pass data values from one automation component to the next. During this webinar, our FME Flow Specialists will cover leveraging the three types of these output attributes & parameters in FME Flow: Event, Custom, and Automation. As a bonus, they’ll also be making use of the Split-Merge Block functionality.
You’ll leave this webinar with a better understanding of how to maximize the potential of automations by making use of attributes & automation parameters, with the ultimate goal of setting your enterprise integration workflows up on autopilot.
High performance Serverless Java on AWS- GoTo Amsterdam 2024Vadym Kazulkin
Java is for many years one of the most popular programming languages, but it used to have hard times in the Serverless community. Java is known for its high cold start times and high memory footprint, comparing to other programming languages like Node.js and Python. In this talk I'll look at the general best practices and techniques we can use to decrease memory consumption, cold start times for Java Serverless development on AWS including GraalVM (Native Image) and AWS own offering SnapStart based on Firecracker microVM snapshot and restore and CRaC (Coordinated Restore at Checkpoint) runtime hooks. I'll also provide a lot of benchmarking on Lambda functions trying out various deployment package sizes, Lambda memory settings, Java compilation options and HTTP (a)synchronous clients and measure their impact on cold and warm start times.
High performance Serverless Java on AWS- GoTo Amsterdam 2024
Php Map Script Class Reference
1. PHP/Mapscript Class Reference
PHP/Mapscript Class Reference
Document Actions
•
•
Note: This is the print view with all the Reference Manual pages on one page. The paginated version is
available here, if you prefer that.
Classes, properties and methods associated with the PHP/Mapscript module.
1. Introduction
Description of document, and associated background pages.
Author: Jeff McKenna
Contact: jmckenna(at)gatewaygeomatics.com
README version: r7813
Last Updated: 2008/07/16
Abstract
This document describes all of the classes, properties and methods associated with the PHP/Mapscript
module, and is the online version of the PHP/Mapscript README file from the Mapserver source code.
Introduction
PHP MapScript was originally developed for PHP-3.0.14 but after MapServer 3.5 support for PHP3 has been
dropped and as of the last update of this document, PHP 4.1.2 or more recent was required.
The module has been tested and used on Linux, Solaris, *BSD, and WinNT.
This module is constantly under development.
How to Get More Information on PHP/Mapscript
• The main resource for help is the PHP/MapScript page on MapTools.org.
• The MapServer Wiki might have more information on this module
• For installation questions regarding the PHP/Mapscript module, see the PHP/Mapscript Installation
HOWTO
• Also, see the Mapserver MapScript API reference and the MapServer MapFile documentation
• Refer to the main PHP site for their official documentation
2. Constants
List of MapServer constants available.
1/36
2. • Constant names and class member variable names are case-sensitive in PHP.
• Several MapScript functions (all those that access files in the back end such as ms_newMapObj(),
drawMap(), etc) will affect the value of the current working directory (CWD) in the PHP
environment. This will be fixed eventually but in the meantime you should be careful about these
side-effects.
The following MapServer constants are available:
Boolean values:
MS_TRUE, MS_FALSE, MS_ON, MS_OFF, MS_YES, MS_NO
Map units:
MS_INCHES, MS_FEET, MS_MILES, MS_METERS, MS_KILOMETERS, MS_DD,
MS_PIXELS
Layer types:
MS_LAYER_POINT, MS_LAYER_LINE, MS_LAYER_POLYGON,
MS_LAYER_RASTER, MS_LAYER_ANNOTATION, MS_LAYER_QUERY,
MS_LAYER_CIRCLE, MS_LAYER_TILEINDEX, MS_LAYER_CHART
Layer/Legend/Scalebar/Class Status:
MS_ON, MS_OFF, MS_DEFAULT, MS_EMBED, MS_DELETE
Layer alpha transparency : allows alpha transparent pixmaps
to be used with RGB map images
MS_GD_ALPHA
Font types:
MS_TRUETYPE, MS_BITMAP
Label positions:
MS_UL, MS_LR, MS_UR, MS_LL, MS_CR, MS_CL, MS_UC, MS_LC,
MS_CC, MS_AUTO, MS_XY, MS_FOLLOW
Bitmap font styles:
MS_TINY , MS_SMALL, MS_MEDIUM, MS_LARGE, MS_GIANT
Shape types:
MS_SHAPE_POINT, MS_SHAPE_LINE, MS_SHAPE_POLYGON, MS_SHAPE_NULL
Shapefile types:
MS_SHP_POINT, MS_SHP_ARC, MS_SHP_POLYGON, MS_SHP_MULTIPOINT
Query/join types:
MS_SINGLE, MS_MULTIPLE
Querymap styles:
MS_NORMAL, MS_HILITE, MS_SELECTED
Connection Types:
MS_INLINE, MS_SHAPEFILE, MS_TILED_SHAPEFILE, MS_SDE, MS_OGR,
MS_TILED_OGR, MS_POSTGIS, MS_WMS, MS_ORACLESPATIAL, MS_WFS,
MS_GRATICULE, MS_MYGIS, MS_RASTER, MS_PLUGIN
Error codes:
MS_NOERR, MS_IOERR, MS_MEMERR, MS_TYPEERR, MS_SYMERR,
MS_REGEXERR, MS_TTFERR, MS_DBFERR, MS_GDERR, MS_IDENTERR,
MS_EOFERR, MS_PROJERR, MS_MISCERR, MS_CGIERR, MS_WEBERR,
MS_IMGERR, MS_HASHERR, MS_JOINERR, MS_NOTFOUND, MS_SHPERR,
MS_PARSEERR, MS_SDEERR, MS_OGRERR, MS_QUERYERR, MS_WMSERR,
MS_WMSCONNERR, MS_ORACLESPATIALERR, MS_WFSERR, MS_WFSCONNERR,
MS_MAPCONTEXTERR, MS_HTTPERR, MS_WCSERR
2/36
3. Symbol types:
MS_SYMBOL_SIMPLE, MS_SYMBOL_VECTOR, MS_SYMBOL_ELLIPSE,
MS_SYMBOL_PIXMAP, MS_SYMBOL_TRUETYPE, MS_SYMBOL_CARTOLINE
Image Mode types (outputFormatObj):
MS_IMAGEMODE_PC256, MS_IMAGEMODE_RGB, MS_IMAGEMODE_RGBA,
MS_IMAGEMODE_INT16, MS_IMAGEMODE_FLOAT32, MS_IMAGEMODE_BYTE,
MS_IMAGEMODE_NULL
Style/Attribue binding:
MS_STYLE_BINDING_SIZE, MS_STYLE_BINDING_ANGLE, MS_STYLE_BINDING_COLOR,
MS_STYLE_BINDING_OUTLINECOLOR, MS_STYLE_BINDING_SYMBOL
Label/Attribute binding:
MS_LABEL_BINDING_SIZE, MS_LABEL_BINDING_ANGLE, MS_LABEL_BINDING_COLOR,
MS_LABEL_BINDING_OUTLINECOLOR, MS_LABEL_BINDING_FONT,
MS_LABEL_BINDING_PRIORITY
Alignment:
MS_ALIGN_LEFT, MS_ALIGN_CENTER, MS_ALIGN_RIGHT
3. Functions
List of functions available.
• Constant names and class member variable names are case-sensitive in PHP.
• Several MapScript functions (all those that access files in the back end such as ms_newMapObj(),
drawMap(), etc.) will affect the value of the current working directory (CWD) in the PHP
environment. This will be fixed eventually but in the meantime you should be careful about these
side-effects.
The following MapServer functions are available:
string ms_GetVersion()
Returns the MapServer version and options in a string. This string
can be parsed to find out which modules were compiled in, etc.
int ms_GetVersionInt()
Returns the MapServer version number (x.y.z) as an integer
(x*10000 + y*100 + z). (New in v5.0) e.g. V5.4.3 would return 50403.
array ms_TokenizeMap(string map_file_name)
Preparses a mapfile through the MapServer parser and return an
array with one item for each token from the mapfile. Strings,
logical expressions, regex expressions and comments are returned
as individual tokens.
void ms_ioinstallstdouttobuffer()
Installs a mapserver IO handler directing future stdout output
to a memory buffer.
void ms_ioinstallstdinfrombuffer()
Installs a mapserver IO handler directing future stdin reading
(ie. post request capture) to come from a buffer.
void ms_iogetstdoutbufferstring()
Fetch the current stdout buffer contents as a string. This method
does not clear the buffer.
int ms_iogetStdoutBufferBytes()
3/36
4. Writes the current buffer to stdout. The PHP header() function should be
used to set the documents's content-type prior to calling the function.
Returns the number of bytes written if output is sent to stdout.
See http://mapserver.gis.umn.edu/docs/howto/wxs_mapscript/view for
more info.
void ms_ioresethandlers()
Resets the default stdin and stdout handlers in place of quot;bufferquot; based
handlers.
void ms_iostripstdoutbuffercontenttype()
Strip the Content-type header off the stdout buffer if it has one, and
if a content type is found it is return. Otherwise return false.
4. Classes
List of classes available.
4.1. ClassObj Class
Constructor, members, and methods.
Constructor:
Class Objects can be returned by the LayerObj class, or can be created
using:
classObj ms_newClassObj(layerObj layer [, classObj class])
The second argument class is optional. If given, the new class
created will be a copy of this class.
Members:
string name
string title
int type
int status (MS_ON, MS_OFF or MS_DELETE)
double minscaledenom
double maxscaledenom
double minscale (Deprecated in v5.0, use minscaledenom instead)
double maxscale (Deprecated in v5.0, use maxscaledenom instead)
string template
labelObj label
int numstyles
string keyimage
string group
Methods:
int set(string property_name, new_value)
Set object property to a new value. Returns -1 on error.
int setExpression(string expression)
Set the expression string for the class object.
string getExpressionString()
Returns the expression string for the class object.
string getExpression()
Deprecated in v5.0. Use getExpressionString() instead.
int settext(string text)
Set the text string for the class object.
4/36
5. string getTextString()
Returns the text string for the class object.
int drawLegendIcon(int width, int height, imageObj im, int dstX, int dstY)
Draw the legend icon on im object at dstX, dstY.
Returns MS_SUCCESS/MS_FAILURE.
imageObj createLegendIcon(int width, int height)
Draw the legend icon and return a new imageObj.
styleObj getStyle(int index)
Return the style object using an index. index >= 0 &&
index < class->numstyles.
classObj clone()
Returns a cloned copy of the class.
int movestyleup(int index)
The style specified by the style index will be moved up into
the array of classes. Returns MS_SUCCESS or MS_FAILURE.
ex calss->movestyleup(1) will have the effect of moving style 1
up to postion 0, and the style at position 0 will be moved
to position 1.
int movestyledown(int index)
The style specified by the style index will be moved down into
the array of classes. Returns MS_SUCCESS or MS_FAILURE.
ex class->movestyledown(0) will have the effect of moving style 0
up to postion 1, and the style at position 1 will be moved
to position 0.
int deletestyle(int index)
Delete the style specified by the style index. If there are any
style that follow the deleted style, their index will decrease by 1.
NOTE : if you are using the numstyles parameter while using the
deletestyle function on the class object you need to refetch
a new class object. Example :
//class has 2 styles
$class = $oLayer->getclass(0);
$class->deletestyle(1);
echo $class->numstyles; : will echo 2
$class = $oLayer->getclass(0);
echo $class->numstyles; : will echo 1
int getMetaData(string name)
Fetch class metadata entry by name. Returns quot;quot; if no entry
matches the name. Note that the search is case sensitive.
int setMetaData(string name, string value)
Set a metadata entry for the class. Returns MS_SUCCESS/MS_FAILURE.
int removeMetaData(string name)
Remove a metadata entry for the class. Returns MS_SUCCESS/MS_FAILURE.
4.2. ColorObj Class
Constructor, members, and methods.
5/36
6. • Constant names and class member variable names are case-sensitive in PHP.
• Several MapScript functions (all those that access files in the back end such as ms_newMapObj(),
drawMap(), etc.) will affect the value of the current working directory (CWD) in the PHP
environment. This will be fixed eventually but in the meantime you should be careful about these
side-effects.
Constructor:
Instances of ColorObj are always embedded inside other classes.
Members:
int red
int green
int blue
Methods:
void setRGB(int red, int green, int blue)
Set red, green, blue values.
4.3. ErrorObj Class
Functions, members, and methods.
• Constant names and class member variable names are case-sensitive in PHP.
• Several MapScript functions (all those that access files in the back end such as ms_newMapObj(),
drawMap(), etc.) will affect the value of the current working directory (CWD) in the PHP
environment. This will be fixed eventually but in the meantime you should be careful about these
side-effects.
Instances of errorObj are created internally by MapServer as errors
happen. Errors are managed as a chained list with the first item being
the most recent error. The head of the list can be fetched using
ms_GetErrorObj(), and the list can be cleared using ms_ResetErrorList()
Functions:
errorObj ms_GetErrorObj()
Returns a reference to the head of the list of errorObj.
void ms_ResetErrorList()
Clear the current error list.
Note that clearing the list invalidates any errorObj handles obtained
via the $error->next() method.
Members:
int code /* See error code constants above */
string routine
string message
Method:
errorObj next()
Returns the next errorObj in the list, or NULL if we reached the end
of the list.
Example:
This example draws a map and reports all errors generated during
6/36
7. the draw() call, errors can potentially come from multiple layers.
ms_ResetErrorList();
$img = $map->draw();
$error = ms_GetErrorObj();
while($error && $error->code != MS_NOERR)
{
printf(quot;Error in %s: %s<br>nquot;, $error->routine, $error->message);
$error = $error->next();
}
4.4. GridObj Class
Constructor, members, and methods.
• Constant names and class member variable names are case-sensitive in PHP.
• Several MapScript functions (all those that access files in the back end such as ms_newMapObj(),
drawMap(), etc.) will affect the value of the current working directory (CWD) in the PHP
environment. This will be fixed eventually but in the meantime you should be careful about these
side-effects.
Constructor :
The grid is always embedded inside a layer object defined as
a grid (layer->connectiontype = MS_GRATICULE)
(for more docs : http://mapserver.gis.umn.edu/cgi-bin/wiki.pl?MapServerGrid)
A layer can become a grid layer by adding a grid object to it using :
ms_newGridObj(layerObj layer)
Example : $oLayer = ms_newlayerobj($oMap);
$oLayer->set(quot;namequot;, quot;GRIDquot;);
ms_newgridobj($oLayer);
$oLayer->grid->set(quot;labelformatquot;, quot;DDMMSSquot;);
Members:
double minsubdivide;
double maxsubdivide;
double minarcs;
double maxacrs;
double mininterval;
double maxinterval;
string labelformat;
Method :
int set(string property_name, new_value)
Set object property to a new value.
4.5. ImageObj Class
Constructor, members, and methods.
• Constant names and class member variable names are case-sensitive in PHP.
• Several MapScript functions (all those that access files in the back end such as ms_newMapObj(),
drawMap(), etc.) will affect the value of the current working directory (CWD) in the PHP
7/36
8. environment. This will be fixed eventually but in the meantime you should be careful about these
side-effects.
Constructor:
Instances of ImageObj are always created by the map class methods.
Members:
int width (read-only)
int height (read-only)
string imagepath
string imageurl
Methods:
void free()
Destroys resources used by an image object.
int saveImage(string filename, MapObj oMap)
Writes image object to specifed filename.
Passing an empty filename sends output to stdout. In this case,
the PHP header() function should be used to set the documents's
content-type prior to calling saveImage().
The output format is the one that is currently selected in the
map file.
The second argument oMap is not manadatory. It is usful when
saving to formats like GTIFF that needs georeference informations
contained in the map file.
The function returns -1 on error. On success, it returns either 0
if writing to an external file, or the number of bytes written if
output is sent to stdout.
string saveWebImage()
Writes image to temp directory. Returns image URL.
The output format is the one that is currently selected in the
map file.
void pasteImage(imageObj srcImg, int transparentColorHex
[[, int dstX, int dstY], int angle])
Copy srcImg on top of the current imageObj.
transparentColorHex is the color (in 0xrrggbb format) from srcImg
that should be considered transparent (i.e. those pixels won't
be copied). Pass -1 if you don't want any transparent color.
If optional dstx,dsty are provided then it defines the position
where the image should be copied (dstx,dsty = top-left corner
position).
The optional angle is a value between 0 and 360 degrees to rotate
the source image counterclockwise. Note that if an angle is specified
(even if its value is zero) then the dstx and dsty coordinates
specify the CENTER of the destination area.
Note: this function works only with 8 bits GD images (PNG or GIF).
4.6. LabelCacheObj Class
Methods.
• Constant names and class member variable names are case-sensitive in PHP.
• Several MapScript functions (all those that access files in the back end such as ms_newMapObj(),
drawMap(), etc.) will affect the value of the current working directory (CWD) in the PHP
8/36
9. environment. This will be fixed eventually but in the meantime you should be careful about these
side-effects.
Accessible only through the map object (map->labelcache). This object
is only used to give the possiblity to free the label cache
(map->labelcache->free())
Method:
boolean free()
Free the label cache. Returns true on success or false if an error
occurs.
Ex : (map->labelcache->free();
4.7. LabelObj Class
Constructor, members, and methods.
• Constant names and class member variable names are case-sensitive in PHP.
• Several MapScript functions (all those that access files in the back end such as ms_newMapObj(),
drawMap(), etc.) will affect the value of the current working directory (CWD) in the PHP
environment. This will be fixed eventually but in the meantime you should be careful about these
side-effects.
Constructor:
LabelObj are always embedded inside other classes.
Members:
string font
int type
colorObj color
colorObj outlinecolor
int outlinewidth
colorObj shadowcolor
int shadowsizex
int shadowsizey
colorObj backgroundcolor
colorObj backgroundshadowcolor
int backgroundshadowsizex
int backgroundshadowsizey
int size
int minsize
int maxsize
int position
int offsetx
int offsety
double angle
int autoangle
int buffer
int antialias
int wrap
int minfeaturesize
int autominfeaturesize
int mindistance
int partials
int force
string encoding
int align
9/36
10. int maxlength
int minlength
int priority
Methods:
int set(string property_name, new_value)
Set object property to a new value. Returns -1 on error.
int setBinding(const labelbinding, string value)
Set the attribute binding for a specfiled label property. Returns true on success.
Example:
$oLabel->setbinding(MS_LABEL_BINDING_COLOR, quot;FIELD_NAME_COLORquot;);
This would bind the color parameter with the data (ie will extract
the value of the color from the field called quot;FIELD_NAME_COLORquot;
int removeBinding(const labelbinding)
Remove the attribute binding for a specfiled style property. Returns true on success.
Example:
$oStyle->removebinding(MS_LABEL_BINDING_COLOR);
4.8. LayerObj Class
Constructor, members, and methods.
• Constant names and class member variable names are case-sensitive in PHP.
• Several MapScript functions (all those that access files in the back end such as ms_newMapObj(),
drawMap(), etc.) will affect the value of the current working directory (CWD) in the PHP
environment. This will be fixed eventually but in the meantime you should be careful about these
side-effects.
Constructor:
Layer Objects can be returned by the MapObj class, or can be created
using:
layerObj ms_newLayerObj(MapObj map [, layerObj layer])
A second optional argument can be given to ms_newLayerObj() to create
the new layer as a copy of an existing layer. If a layer is given as
argument then all members of a this layer will be copied in the new
layer created.
Members:
int numclasses (read-only)
int index (read-only)
int status (MS_ON, MS_OFF, MS_DEFAULT or MS_DELETE)
int debug
string classitem
string classgroup
string name
string group
string data
int type
int dump
double tolerance
int toleranceunits
int sizeunits
double symbolscaledenom
double minscaledenom
double maxscaledenom
10/36
11. double labelminscaledenom
double labelmaxscaledenom
double symbolscale (Deprecated in v5.0, use symbolscaledenom instead)
double minscale (Deprecated in v5.0, use minscaledenom instead)
double maxscale (Deprecated in v5.0, use maxscaledenom instead)
double labelminscale (Deprecated in v5.0, use labelminscaledenom instead)
double labelmaxscale (Deprecated in v5.0, use labelmaxscaledenom instead)
int maxfeatures
colorObj offsite
int annotate
int transform
int labelcache
int postlabelcache
string labelitem
string labelsizeitem
string labelangleitem
string tileitem
string tileindex
string header
string footer
string connection
int connectiontype
string filteritem
string template
int opacity
int transparency (Deprecated in v5.0. Use opacity instead.)
string styleitem
gridObj grid //only available on a layer defined as grid (MS_GRATICULE)
int num_processing
string requires
string labelrequires
Methods:
int set(string property_name, new_value)
Set object property to a new value. Returns -1 on error.
int draw(imageObj image)
Draw a single layer, add labels to cache if required.
Returns -1 on error.
int drawQuery(imageObj image)
Draw query map for a single layer.
classObj getClass(int classIndex)
Returns a classObj from the layer given an index value (0=first class)
int queryByPoint(pointObj point, int mode, double buffer)
Query layer at point location specified in georeferenced map
coordinates (i.e. not pixels).
The query is performed on all the shapes that are part of a CLASS
that contains a TEMPLATE value or that match any class in a
layer that contains a LAYER TEMPLATE value.
Mode is MS_SINGLE or MS_MULTIPLE depending on number of results
you want.
Passing buffer -1 defaults to tolerances set in the map file
(in pixels) but you can use a constant buffer (specified in
ground units) instead.
Returns MS_SUCCESS if shapes were found or MS_FAILURE if nothing
was found or if some other error happened (note that the error
message in case nothing was found can be avoided in PHP using
the '@' control operator).
int queryByRect(rectObj rect)
11/36
12. Query layer using a rectangle specified in georeferenced map
coordinates (i.e. not pixels).
The query is performed on all the shapes that are part of a CLASS
that contains a TEMPLATE value or that match any class in a
layer that contains a LAYER TEMPLATE value.
Returns MS_SUCCESS if shapes were found or MS_FAILURE if nothing
was found or if some other error happened (note that the error
message in case nothing was found can be avoided in PHP using
the '@' control operator).
int queryByShape(shapeObj shape)
Query layer based on a single shape, the shape has to be a polygon
at this point.
Returns MS_SUCCESS if shapes were found or MS_FAILURE if nothing
was found or if some other error happened (note that the error
message in case nothing was found can be avoided in PHP using
the '@' control operator).
int queryByFeatures(int slayer)
Perform a query set based on a previous set of results from
another layer. At present the results MUST be based on a polygon
layer.
Returns MS_SUCCESS if shapes were found or MS_FAILURE if nothing
was found or if some other error happened (note that the error
message in case nothing was found can be avoided in PHP using
the '@' control operator).
int queryByAttributes(string qitem, string qstring, int mode)
Query layer for shapes that intersect current map extents.
qitem is the item (attribute) on which the query is performed,
and qstring is the expression to match.
The query is performed on all the shapes that are part of a CLASS
that contains a TEMPLATE value or that match any class in a
layer that contains a LAYER TEMPLATE value.
Note that the layer's FILTER/FILTERITEM are ignored by this function.
Mode is MS_SINGLE or MS_MULTIPLE depending on number of results
you want.
Returns MS_SUCCESS if shapes were found or MS_FAILURE if nothing
was found or if some other error happened (note that the error
message in case nothing was found can be avoided in PHP using
the '@' control operator).
int setFilter(string expression)
Set layer filter expression.
string getFilterString()
Returns the expression for this layer.
string getFilter()
Deprecated in v5.0, use getFilterString() instead.
string getProjection()
Returns a string represenation of the projection. If no
projection is set, MS_FALSE is returned.
int setProjection(string proj_params)
Set layer projection and coordinate system. Parameters are given as
a single string of comma-delimited PROJ.4 parameters.
int setWKTProjection(string proj_params)
Same as setProjection(), but takes an OGC WKT projection
definition string as input.
int getNumResults()
12/36
13. Returns the number of results from this layer in the last query.
resultCacheMemberObj getResult(int index)
Returns a resultCacheMemberObj by index from a layer object with
index in the range 0 to numresults-1.
Returns a valid object or FALSE(0) if index is invalid.
int open()
Open the layer for use with getShape().
Returns MS_SUCCESS/MS_FAILURE.
int whichshapes(rectobj)
Performs a spatial, and optionally an attribute based feature search.
The function basically prepares things so that candidate features can be
accessed by query or drawing functions (eg using nextshape function).
Returns MS_SUCCESS or MS_FAILURE.
shapeobj nextShape()
Called after msWhichShapes has been called to actually retrieve shapes
within a given area
returns a shape object or MS_FALSE
example of usage :
$map = ms_newmapobj(quot;d:/msapps/gmap-ms40/htdocs/gmap75.mapquot;);
$layer = $map->getLayerByName('road');
$status = $layer->open();
$status = $layer->whichShapes($map->extent);
while ($shape = $layer->nextShape())
{
echo $shape->index .quot;<br>nquot;;
}
$layer->close();
void close()
Close layer previously opened with open().
shapeObj getFeature(int shapeindex [, int tileindex = -1])
Retrieve shapeObj from a layer by index.
Tileindex is optional and is used only for tiled shapefiles
(you get it from the resultCacheMemberObj returned by getResult()
for instance).
Simply omit or pass tileindex = -1 for other data sources.
shapeObj getShape(int tileindex, int shapeindex)
Deprecated in v5.0, use getFeature() instead (note that the order
of the arguments is reversed since tileindex is optional in
getFeature())
rectObj getExtent()
Returns the layer's data extents.
If the layer's EXTENT member is set then this value is used,
otherwise this call opens/closes the layer to read the
extents. This is quick on shapefiles, but can be
an expensive operation on some file formats or data sources.
This function is safe to use on both opened or closed layers: it
is not necessary to call open()/close() before/after calling it.
int addFeature(shapeObj shape)
Add a new feature in a layer. Returns -1 on error.
int getMetaData(string name)
Fetch layer metadata entry by name. Returns quot;quot; if no entry
13/36
14. matches the name. Note that the search is case sensitive.
int setMetaData(string name, string value)
Set a metadata entry for the layer. Returns MS_SUCCESS/MS_FAILURE.
int removeMetaData(string name)
Remove a metadata entry for the layer. Returns MS_SUCCESS/MS_FAILURE.
string getWMSFeatureInfoURL(int clickX, int clickY, int featureCount,
string infoFormat)
Return a WMS GetFeatureInfo URL (works only for WMS layers)
clickX, clickY is the location of to query in pixel coordinates
with (0,0) at the top left of the image.
featureCount is the number of results to return.
infoFormat is the format the format in which the result should be
requested. Depends on remote server's capabilities. MapServer
WMS servers support only quot;MIMEquot; (and should support quot;GML.1quot; soon).
Returns quot;quot; and outputs a warning if layer is not a WMS layer
or if it is not queriable.
aString getItems()
return a list of items. Must call open function first.
boolean setProcessing(string)
Add the string to the processing string list for the layer.
The layer->num_processing is incremented by 1.
Ex : $oLayer->setprocessing(quot;SCALE_1=AUTOquot;);
$oLayer->setprocessing(quot;SCALE_2=AUTOquot;);
aString getProcessing()
Returns an array containing the processing strings
boolean clearProcessing()
Clears all the processing strings
string executeWFSGetfeature()
Executes a GetFeature request on a WFS layer and returns the
name of the temporary GML file created. Returns an empty
string on error.
int applySLD(string sldxml, string namedlayer)
Apply the SLD document to the layer object.
The matching between the sld document and the layer will be done
using the layer's name.
If a namedlayer argument is passed (argument is optional),
the NamedLayer in the sld that matchs it will be used to style
the layer.
See SLD How to for more information on the SLD support.
int applySLDURL(string sldurl, string namedlayer)
Apply the SLD document pointed by the URL to the layer object. The
matching between the sld document and the layer will be done using
the layer's name.
If a namedlayer argument is passed (argument is optional),
the NamedLayer in the sld that matchs it will be used to style
the layer.
See SLD How to for more information on the SLD support.
string generateSLD()
Returns an SLD XML string based on all the classes found in the layers.
int moveclassup(int index)
The class specified by the class index will be moved up into
the array of layers. Returns MS_SUCCESS or MS_FAILURE.
14/36
15. ex layer->moveclassup(1) will have the effect of moving class 1
up to postion 0, and the class at position 0 will be moved
to position 1.
int moveclassdown(int index)
The class specified by the class index will be moved down into
the array of layers. Returns MS_SUCCESS or MS_FAILURE.
ex layer->moveclassdown(0) will have the effect of moving class 0
up to postion 1, and the class at position 1 will be moved
to position 0.
classObj removeClass(int index)
Removes the class indicated and returns a copy, or NULL in the case
of a failure. Note that subsequent classes will be renumbered by
this operation. The numclasses field contains the number of classes
available.
boolean isVisible()
Returns MS_TRUE/MS_FALSE depending on whether the layer is
currently visible in the map (i.e. turned on, in scale, etc.).
4.9. LegendObj Class
Constructor, members, and methods.
LegendObj Class
• Constant names and class member variable names are case-sensitive in PHP.
• Several MapScript functions (all those that access files in the back end such as ms_newMapObj(),
drawMap(), etc.) will affect the value of the current working directory (CWD) in the PHP
environment. This will be fixed eventually but in the meantime you should be careful about these
side-effects.
Constructor:
Instances of legendObj are always are always embedded inside the mapObj.
Members:
int height;
int width;
int keysizex;
int keysizey;
int keyspacingx;
int keyspacingy;
colorObj outlinecolor; //Color of outline of box, -1 for no outline
int status; //MS_ON, MS_OFF, MS_EMBED
int position; //for embeded legends, MS_UL, MS_UC, ...
int transparent;
int interlace;
int postlabelcache; //MS_TRUE, MS_FALSE
labelObj label;
colorObj imagecolor;
string template
Methods:
int set(string property_name, new_value)
Set object property to a new value. Returns -1 on error.
15/36
16. 4.10. LineObj Class
Constructor, members, and methods.
• Constant names and class member variable names are case-sensitive in PHP.
• Several MapScript functions (all those that access files in the back end such as ms_newMapObj(),
drawMap(), etc.) will affect the value of the current working directory (CWD) in the PHP
environment. This will be fixed eventually but in the meantime you should be careful about these
side-effects.
Constructor:
LineObj ms_newLineObj()
Members:
int numpoints (read-only)
Methods:
int add(pointObj point)
Add a point to the end of line.
int addXY(double x, double y [, double m])
Add a point to the end of line.
Note : the 3rd parameter m is used for measured shape files only.
It is not mandatory.
int addXYZ(double x, double y, double z [, double m])
Add a point to the end of line.
Note : the 4th parameter m is used for measured shape files only.
It is not mandatory.
PointObj point(int i)
Returns a reference to point number i. Reference is valid only
during the life of the lineObj that contains the point.
int project(projectionObj in, projectionObj out)
Project the line from quot;inquot; projection (1st argument) to quot;outquot;
projection (2nd argument). Returns MS_SUCCESS/MS_FAILURE.
void free()
Destroys resources used by a line object.
4.11. MapObj Class
Constructor, members, and methods.
• Constant names and class member variable names are case-sensitive in PHP.
• Several MapScript functions (all those that access files in the back end such as ms_newMapObj(),
drawMap(), etc.) will affect the value of the current working directory (CWD) in the PHP
environment. This will be fixed eventually but in the meantime you should be careful about these
side-effects.
Constructor:
mapObj ms_newMapObj(string map_file_name [, string new_map_path])
Returns a new object to deal with a MapServer map file.
16/36
17. By default, the SYMBOLSET, FONTSET, and other paths in the mapfile
are relative to the mapfile location. If new_map_path is provided
then this directory will be used as the base path for all the
relative paths inside the mapfile.
Members:
int numlayers (read-only)
string name
int status
int debug
int width (see setSize())
int height (see setSize())
int maxsize
outputformatObj outputformat
double resolution (pixels per inch, defaults to 72)
rectObj extent;
double cellsize
int units (map units type)
double scaledenom (read-only, set by drawMap())
double scale (Deprecated in v5.0. Use scaledenom instead)
string shapepath
int keysizex
int keysizey
int keyspacingx
int keyspacingy
webObj web
referenceMapObj reference
colorObj imagecolor
scalebarObj scalebar
legendObj legend
string symbolsetfilename (read-only, set by setSymbolSet())
string fontsetfilename (read-only, set by setFontSet())
labelcacheObj labelcache (no members. Used only to be able to free the
the label cache (ex : map->labelcache->free())
int transparent (deprecated, use outputFormatObj)
int interlace (deprecated, use outputFormatObj)
int imagetype (deprecated, use outputFormatObj)
int imagequality (deprecated, use outputFormatObj)
Methods:
mapObj clone()
Returns a handle to a new mapObj which is a clone of the current
mapObj. All parameters in the current mapObj are copied to the
new mapObj. Returns NULL (0) on error.
int set(string property_name, new_value)
Set map object property to new value. Returns -1 on error.
int getsymbolbyname(string symbol_name)
Returns the symbol index using the name.
symbol getsymbolobjectbyid(int symbolid)
Returns the symbol object using a symbol id. Refer to
the symbol object reference section for more details.
void preparequery()
Calculate the scale of the map and set map->scaledenom.
imageObj prepareImage()
Return handle on blank image object.
17/36
18. imageObj draw()
Render map and return handle on image object.
imageObj drawQuery()
Render a query map and return handle on image object.
imageObj drawLegend()
Render legend and return handle on image object.
imageObj drawReferenceMap()
Render reference map and return handle on image object.
imageObj drawScaleBar()
Render scale bar and return handle on image object.
int embedlegend(imageObj image)
embeds a legend. Actually the legend is just added to the label
cache so you must invoke drawLabelCache() to actually do the
rendering (unless postlabelcache is set in which case it is
drawn right away).
int embedScalebar(imageObj image)
embeds a scalebar. Actually the scalebar is just added to the label
cache so you must invoke drawLabelCache() to actually do the rendering
(unless postlabelcache is set in which case it is drawn right away).
int drawLabelCache(imageObj image)
Renders the labels for a map. Returns -1 on error.
layerObj getLayer(int index)
Returns a layerObj from the map given an index value (0=first layer)
layerObj getLayerByName(string layer_name)
Returns a layerObj from the map given a layer name.
Returns FALSE if layer doesn't exist.
colorObj getcolorbyindex(int iCloIndex)
Returns a colorObj corresponding to the color index in the palette
void setExtent(double minx, double miny, double maxx, double maxy)
Set the map extents using the georef extents passed in argument.
int setRotation(double rotation_angle)
Set map rotation angle. The map view rectangle (specified in
EXTENTS) will be rotated by the indicated angle in the counter-
clockwise direction. Note that this implies the rendered map
will be rotated by the angle in the clockwise direction.
Returns MS_SUCCESS or MS_FAILURE.
int setSize(int width, int height)
Set the map width and height. This method updates the internal
geotransform and other data structures required for map rotation
so it should be used instead of setting the width and height members
directly.
Returns MS_SUCCESS or MS_FAILURE.
void zoompoint(int nZoomFactor, pointObj oPixelPos, int nImageWidth,
int nImageHeight, rectObj oGeorefExt)
Zoom to a given XY postion;
Parmeters are :
- Zoom factor : positive values do zoom in, negative values
zoom out. Factor of 1 will recenter.
18/36
19. - Pixel position (pointObj) : x, y coordinates of the click,
with (0,0) at the top-left
- Width : width in pixel of the current image.
- Height : Height in pixel of the current image.
- Georef extent (rectObj) : current georef extents.
- MaxGeoref extent (rectObj) : (optional) maximum georef extents.
If provided then it will be impossible to zoom/pan outside of
those extents.
void zoomrectangle(rectObj oPixelExt, int nImageWidth, int nImageHeight,
rectObj oGeorefExt)
Set the map extents to a given extents.
Parmeters are :
- oPixelExt (rect object) : Pixel Extents, with (0,0) at the top-left
The rectangle contains the coordinates of the LL and UR coordinates
in pixel. (the maxy in the rect object should be < miny value)
------- UR (values in the rect object : maxx, maxy)
| |
| |
| |
------
LL (values in the rectobject minx, miny)
- Width : width in pixel of the current image.
- Height : Height in pixel of the current image.
- Georef extent (rectObj) : current georef extents.
void zoomscale(double nScaleDenom, pointObj oPixelPos, int nImageWidth,
int nImageHeight, rectObj oGeorefExt [, rectObj oMaxGeorefExt])
Zoom in or out to a given XY position so that the map is displayed
at specified scale.
Parmeters are :
- ScaleDenom : Scale denominator of the scale at which the map
should be displayed.
- Pixel position (pointObj) : x, y coordinates of the click,
with (0,0) at the top-left
- Width : width in pixel of the current image.
- Height : Height in pixel of the current image.
- Georef extent (rectObj) : current georef extents.
- MaxGeoref extent (rectObj) : (optional) maximum georef extents.
If provided then it will be impossible to zoom/pan outside of
those extents.
int queryByPoint(pointObj point, int mode, double buffer)
Query all selected layers in map at point location specified in
georeferenced map coordinates (i.e. not pixels).
The query is performed on all the shapes that are part of a CLASS
that contains a TEMPLATE value or that match any class in a
layer that contains a LAYER TEMPLATE value.
Mode is MS_SINGLE or MS_MULTIPLE depending on number of results
you want.
Passing buffer -1 defaults to tolerances set in the map file
(in pixels) but you can use a constant buffer (specified in
ground units) instead.
Returns MS_SUCCESS if shapes were found or MS_FAILURE if nothing
was found or if some other error happened (note that the error
message in case nothing was found can be avoided in PHP using
the '@' control operator).
int queryByRect(rectObj rect)
19/36
20. Query all selected layers in map using a rectangle specified in
georeferenced map coordinates (i.e. not pixels).
The query is performed on all the shapes that are part of a CLASS
that contains a TEMPLATE value or that match any class in a
layer that contains a LAYER TEMPLATE value.
Returns MS_SUCCESS if shapes were found or MS_FAILURE if nothing
was found or if some other error happened (note that the error
message in case nothing was found can be avoided in PHP using
the '@' control operator).
int queryByShape(shapeObj shape)
Query all selected layers in map based on a single shape, the
shape has to be a polygon at this point.
Returns MS_SUCCESS if shapes were found or MS_FAILURE if nothing
was found or if some other error happened (note that the error
message in case nothing was found can be avoided in PHP using
the '@' control operator).
int queryByFeatures(int slayer)
Perform a query based on a previous set of results from
a layer. At present the results MUST be based on a polygon layer.
Returns MS_SUCCESS if shapes were found or MS_FAILURE if nothing
was found or if some other error happened (note that the error
message in case nothing was found can be avoided in PHP using
the '@' control operator).
int queryByIndex(layerindex, tileindex, shapeindex, addtoquery)
Add a specific shape on a given layer to the query result.
If addtoquery (which is a non mandatory argument) is set to MS_TRUE,
the shape will be added to the existing query list. Default behavaior
is to free the existing query list and add only the new shape.
int savequery(filename)
Save the current query in a file. Returns MS_SUCESS or MS_FAILURE.
Can be used with loadquery
int loadquery(filename)
Loads a query from a file. Returns MS_SUCESS or MS_FAILURE.
To be used with savequery.
void freequery(layerindex)
Frees the query result on a specified layer. If the layerindex is -1,
all queries on layers will be freed.
int save(string filename)
Save current map object state to a file. Returns -1 on error.
Use absolute path. If a relative path is used, then it will be
relative to the mapfile location.
string getProjection()
Returns a string represenation of the projection. If no
projection is set, MS_FALSE is returned.
int setProjection(string proj_params, boolean bSetUnitsAndExtents)
Set map projection and coordinate system. Parameters are given as
a single string of comma-delimited PROJ.4 parameters.
The argument : bSetUnitsAndExtents is used to automatically update
the map units and extents based on the new projection. Possible
values are MS_TRUE and MS_FALSE. By defualt it is set at MS_FALSE
int setWKTProjection(string proj_params, boolean bSetUnitsAndExtents)
Same as setProjection(), but takes an OGC WKT projection
definition string as input.
20/36
21. int getMetaData(string name)
Fetch metadata entry by name (stored in the WEB object in the map
file). Returns quot;quot; if no entry matches the name. Note that the
search is case sensitive.
int setMetaData(string name, string value)
Set a metadata entry for the map (stored in the WEB object in the map
file). Returns MS_SUCCESS/MS_FAILURE.
int removeMetaData(string name)
Remove a metadata entry for the map (stored in the WEB object in the map
file). Returns MS_SUCCESS/MS_FAILURE.
array getLayersIndexByGroup(string groupname)
Return an array containing all the layer's indexes given
a group name.
array getAllGroupNames()
Return an array containing all the group names used in the
layers.
array getAllLayerNames()
Return an array containing all the layer names.
boolean moveLayerUp(int layerindex)
Move layer up in the hierarcy of drawing.
boolean moveLayerDown(int layerindex)
Move layer down in the hierarcy of drawing.
array getlayersdrawingorder()
Return an array containing layer's index in the order which they
are drawn.
boolean setlayersdrawingorder(array layeryindex)
Set the layer's order array. The argument passed must be a valid
array with all the layer's index.
Return TRUE on success or else FALSE.
string processtemplate(array params, boolean generateimages)
Process the template file specified in the web object and return
the resut in a buffer.
The processing consists of opening the template file and replace
all the tags found in it.
Only tags that have an equivalent element in the map object are
replaced (ex [scaledenom]).
The are two expetions to the previous statement :
- [img], [scalebar], [ref], [legend] would be replaced with the
appropriate url if the parameter generateimages is set to
MS_TRUE. (Note : the images corresponding to the diffrent objects
are generated if the object is set to MS_ON in the map file)
- the user can use the params parameter to specify tags and
their values. For example if the user have a specific tag call
[my_tag] and would like it to be replaced by quot;value_of_my_tagquot;
he would do :
$tmparray[quot;my_tagquot;] = quot;value_of_my_tagquot;;
$map->processtemplate($tmparray, MS_FALSE);
string processquerytemplate(array params, boolean generateimages)
Process query template files and return the resut in a buffer.
Second argument generateimages is not manadatory. If not given
It will be set to TRUE.
See also : processtemplate function.
21/36
22. string processlegendtemplate(array params)
Process legend template files and return the resut in a buffer.
See also : processtemplate function.
int setSymbolSet(string fileName)
Load and set a symbol file dynamictly.
int getNumSymbols()
Return the number of symbols in map.
int setFontSet(string fileName)
Load and set a new fontset.
int selectOutputFormat(string type)
Selects the output format to be used in the map.
Returns MS_SUCCESS/MS_FAILURE.
Note : the type used should correspond to one of the output
formats declared in the map file.
The type argument passed is compared with the mimetype
parameter in the output format structure and then to
the name parameter in the structure.
int saveMapContext(string filename)
Available only if WMS support is enabled.
Save current map object state in WMS Map Context format.
Only WMS layers are saved in the WMS Map Context XML file.
Returns MS_SUCCESS/MS_FAILURE.
int loadMapContext(string filename [, boolean unique_layer_name])
Available only if WMS support is enabled.
Load a WMS Map Context XML file into the current mapObj.
If the map already contains some layers then the layers defined
in the WMS Map context document are added to the current map.
The 2nd argument unique_layer_name is optional and if set to
MS_TRUE layers created will have a unique name (unique prefix
added to the name). If set to MS_FALSE the layer name will be the
the same name as in the context. The default value is MS_FALSE.
Returns MS_SUCCESS/MS_FAILURE.
int applySLD(string sldxml)
Apply the SLD document to the map file. The matching between the
sld document and the map file will be done using the layer's name.
See SLD How to for more information on the SLD support.
int applySLDURL(string sldurl)
Apply the SLD document pointed by the URL to the map file. The
matching between the sld document and the map file will be done
using the layer's name.
See SLD How to for more information on the SLD support.
string generateSLD()
Returns an SLD XML string based on all the classes found in all
the layers.
string getconfigoption(string key)
Returns the config value associated with the key.
Returns an empty sting if key not found.
int setconfigoption(string key, string value)
22/36
23. Sets a config parameter using the key and the value passed
int applyconfigoptions()
Applies the config options set in the map file. For example
seeting the PROJ_LIB using the setconfigoption only modifies
the value in the map object. applyconfigoptions will actually
change the PROJ_LIB value that will be used when dealing with
projection.
int loadowsparameters(owsrequest request, string version)
Load OWS request parameters (BBOX, LAYERS, &c.) into map. Returns
MS_SUCCESS or MS_FAILURE.
2nd argument version is not mandatory. If not given, the version
will be set to 1.1.1
int owsdispatch(owsrequest request)
Processes and executes the passed OpenGIS Web Services request on the
map. Returns MS_DONE (2) if there is no valid OWS request in the req
object, MS_SUCCESS (0) if an OWS request was successfully processed and
MS_FAILURE (1) if an OWS request was not successfully processed. OWS
requests include WMS, WFS, WCS and SOS requests supported by MapServer.
Results of a dispatched request are written to stdout and can be captured
using the msIO services (ie. ms_ioinstallstdouttobuffer() and
ms_iogetstdoutbufferstring())
int insertLayer( layerObj layer [, int nIndex=-1 ] )
Insert a copy of *layer* into the Map at index *nIndex*. The default
value of *nIndex* is -1, which means the last possible index. Returns
the index of the new Layer, or -1 in the case of a failure.
4.12. OutputFormatObj Class
Constructor, members, and methods.
• Constant names and class member variable names are case-sensitive in PHP.
• Several MapScript functions (all those that access files in the back end such as ms_newMapObj(),
drawMap(), etc.) will affect the value of the current working directory (CWD) in the PHP
environment. This will be fixed eventually but in the meantime you should be careful about these
side-effects.
Constructor :
Instance of outputformatObj is always embedded inside the mapObj.
It is uses a read only.
No constructor available (coming soon, see bug 979)
Members:
string name
string mimetype
string driver
string extension
int renderer
int imagemode // MS_IMAGEMODE_* value.
int transparent
Methods related to the output format :
23/36
24. int set(string property_name, new_value)
Set object property to a new value.
void setOption(string property_name, string new_value)
Add or Modify the format option list. return true on success.
Example: $oMap->outputformat->setOption(quot;OUTPUT_TYPEquot;, quot;RASTERquot;);
string getOption(string property_name)
Returns the associated value for the format option property passed
as argument. Returns an empty string if property not found.
void setFormatOption(string property_name, string new_value)
Deprecated. See setOption().
string getFormatOption(string property_name)
Deprecated. See getOption().
4.13. OwsRequestObj Class
Constructor, members, and methods.
• Constant names and class member variable names are case-sensitive in PHP.
• Several MapScript functions (all those that access files in the back end such as ms_newMapObj(),
drawMap(), etc.) will affect the value of the current working directory (CWD) in the PHP
environment. This will be fixed eventually but in the meantime you should be careful about these
side-effects.
Constructor:
request = ms_newOwsrequestObj();
Create a new ows request object.
Members:
int numparams
Number of parameters in the request object. Read only.
Methods:
int loadparams()
Initializes the OWSRequest object from the cgi environment variables
REQUEST_METHOD, QUERY_STRING and HTTP_COOKIE. Returns the number of
name/value pairs collected.
int setparameter(string name, string value)
Set a request parameter. For example :
$request->setparameter('REQUEST', 'GetMap');
string getname(int index)
Return the name of the parameter at *index* in the request's array
of parameter names.
string getvalue(int index)
Return the value of the parameter at *index* in the request's array
of parameter values.
string getvaluebyname(string name)
Return the value associated with the parameter *name*.
24/36
25. 4.14. PointObj Class
Constructor, members, and methods.
• Constant names and class member variable names are case-sensitive in PHP.
• Several MapScript functions (all those that access files in the back end such as ms_newMapObj(),
drawMap(), etc.) will affect the value of the current working directory (CWD) in the PHP
environment. This will be fixed eventually but in the meantime you should be careful about these
side-effects.
Constructor:
PointObj ms_newPointObj()
Members:
double x
double y
double z (used for 3d shape files. set to 0 for other types)
double m (used only for measured shape files. set to 0 for other types.)
Methods:
int setXY(double x, double y [, double m])
Set X,Y coordinate values.
Note : the 3rd parameter m is used for measured shape files only.
It is not mandatory.
Returns 0 on success, -1 on error.
int setXYZ(double x, double y , double z, [, double m])
Set X,Y,Z coordinate values.
Note : the 4th parameter m is used for measured shape files only.
It is not mandatory.
Returns 0 on success, -1 on error.
int draw(mapObj map, layerObj layer, imageObj img,
int class_index, string text)
Draws the individual point using layer. The class_index is used
to classify the point based on the classes defined for the layer.
The text string is used to annotate the point.
Returns MS_SUCCESS/MS_FAILURE.
double distanceToPoint(pointObj poPoint)
Calculates distance between two points.
double distanceToLine(pointObject p1, pointObject p2)
Calculates distance between a point ad a lined defined by the
two points passed in argument.
double distanceToShape(shapeObj shape)
Calculates the minimum distance between a point and a shape.
int project(projectionObj in, projectionObj out)
Project the point from quot;inquot; projection (1st argument) to quot;outquot;
projection (2nd argument). Returns MS_SUCCESS/MS_FAILURE.
void free()
Releases all resources used by the object.
25/36
26. 4.15. ProjectionObj Class
Constructor.
• Constant names and class member variable names are case-sensitive in PHP.
• Several MapScript functions (all those that access files in the back end such as ms_newMapObj(),
drawMap(), etc.) will affect the value of the current working directory (CWD) in the PHP
environment. This will be fixed eventually but in the meantime you should be careful about these
side-effects.
Constructor:
ProjectionObjObj ms_newProjectionObj(string projectionstring)
Creates a projection object based on the projection string passed
as argument.
Eg : $projInObj = ms_newprojectionobj(quot;proj=latlongquot;) will create a
geographic projection class.
Eg of usage : the following example will convert a lat/long point to
an LCC projection :
$projInObj = ms_newprojectionobj(quot;proj=latlongquot;);
$projOutObj = ms_newprojectionobj(quot;proj=lcc,ellps=GRS80,lat_0=49,quot;.
quot;lon_0=-95,lat_1=49,lat_2=77quot;);
$poPoint = ms_newpointobj();
$poPoint->setXY(-92.0, 62.0);
$poPoint->project($projInObj, $projOutObj);
4.16. QueryMapObj Class
Constructor, members, and methods.
• Constant names and class member variable names are case-sensitive in PHP.
• Several MapScript functions (all those that access files in the back end such as ms_newMapObj(),
drawMap(), etc.) will affect the value of the current working directory (CWD) in the PHP
environment. This will be fixed eventually but in the meantime you should be careful about these
side-effects.
Constructor:
Instances of querymapObj are always are always embedded inside the mapObj.
Members:
int width
int height
int style (MS_NORMAL, MS_HILITE, MS_SELECTED)
colorObj color
Methods:
int set(string property_name, new_value)
Set object property to a new value. Returns -1 on error.
26/36
27. 4.17. RectObj Class
Constructor, members, and methods.
• Constant names and class member variable names are case-sensitive in PHP.
• Several MapScript functions (all those that access files in the back end such as ms_newMapObj(),
drawMap(), etc.) will affect the value of the current working directory (CWD) in the PHP
environment. This will be fixed eventually but in the meantime you should be careful about these
side-effects.
Constructor:
RectObj are sometimes embedded inside other objects. New ones can
also be created with:
RectObj ms_newRectObj() (Note: the memebers (minx, miny,maxx,maxy) are
initialized to -1);
Members:
double minx
double miny
double maxx
double maxy
Methods:
int set(string property_name, new_value)
Set object property to a new value. Returns -1 on error.
void setextent(double minx, double miny, double maxx, double maxy)
Set the rectangle extents.
int draw(mapObj map, layerObj layer, imageObj img,
int class_index, string text)
Draws the individual rectangle using layer. The class_index is used
to classify the rectangle based on the classes defined for the layer.
The text string is used to annotate the rectangle.
Returns MS_SUCCESS/MS_FAILURE.
double fit(int width, int height)
Adjust extents of the rectangle to fit the width/height specified.
int project(projectionObj in, projectionObj out)
Project the rectangle from quot;inquot; projection (1st argument) to quot;outquot;
projection (2nd argument). Returns MS_SUCCESS/MS_FAILURE.
void free()
Destroys resources used by a rect object.
4.18. ReferenceMapObj Class
Constructor, members, and methods.
• Constant names and class member variable names are case-sensitive in PHP.
• Several MapScript functions (all those that access files in the back end such as ms_newMapObj(),
drawMap(), etc.) will affect the value of the current working directory (CWD) in the PHP
environment. This will be fixed eventually but in the meantime you should be careful about these
27/36
28. side-effects.
Constructor:
Instances of referenceMapObj are always embedded inside the mapObj.
Members:
string image
int width
int height
int status
rectObj extent
ColorObj color
ColorObj outlinecolor
Method :
int set(string property_name, new_value)
Set object property to a new value. Returns -1 on error.
4.19. ResultCacheMemberObj
Constructor and members.
• Constant names and class member variable names are case-sensitive in PHP.
• Several MapScript functions (all those that access files in the back end such as ms_newMapObj(),
drawMap(), etc.) will affect the value of the current working directory (CWD) in the PHP
environment. This will be fixed eventually but in the meantime you should be careful about these
side-effects.
Constructor:
Instances of ResultCacheMemberObj are always obtained through
layerObj's getResult() method.
Members:
int shapeindex (read-only)
int tileindex (read-only)
int classindex (read-only)
4.20. ScalebarObj Class
Constructor, members, and methods.
• Constant names and class member variable names are case-sensitive in PHP.
• Several MapScript functions (all those that access files in the back end such as ms_newMapObj(),
drawMap(), etc.) will affect the value of the current working directory (CWD) in the PHP
environment. This will be fixed eventually but in the meantime you should be careful about these
side-effects.
Constructor:
Instances of scalebarObj are always are always embedded inside the mapObj.
Members:
28/36
29. int height;
int width;
int style;
int intervals;
colorObj color;
colorObj backgroundcolor;
colorObj outlinecolor;
int units;
int status; //MS_ON, MS_OFF, MS_EMBED
int position; //for embeded scalebars, MS_UL, MS_UC, ...
int transparent;
int interlace;
int postlabelcache;
labelObj label;
colorObj imagecolor;
int align;
Methods:
int set(string property_name, new_value)
Set object property to a new value. Returns -1 on error.
int setimagecolor(int red, int green, int blue)
Sets the imagecolor propery (baclground) of the object.
Returns false on error.
4.21. ShapefileObj Class
Constructor, members, and methods.
• Constant names and class member variable names are case-sensitive in PHP.
• Several MapScript functions (all those that access files in the back end such as ms_newMapObj(),
drawMap(), etc.) will affect the value of the current working directory (CWD) in the PHP
environment. This will be fixed eventually but in the meantime you should be careful about these
side-effects.
Constructor:
shapefileObj ms_newShapefileObj(string filename, int type)
Opens a shapefile and returns a new object to deal with it.
Filename should be passed with no extension.
To create a new file (or overwrite an existing one), type should
be one of MS_SHP_POINT, MS_SHP_ARC, MS_SHP_POLYGON or
MS_SHP_MULTIPOINT.
Pass type as -1 to open an existing file for read-only access,
and type=-2 to open an existing file for update (append).
Members:
int numshapes (read-only)
int type (read-only)
string source (read-only)
rectObj bounds (read-only)
Methods:
shapeObj getShape(int i)
Retrieve shape by index.
shapeObj getPoint(int i)
Retrieve point by index.
29/36
30. shapeObj getTransformed(mapObj map, int i)
Retrieve shape by index.
rectObj getExtent(int i)
Retrieve a shape's bounding box by index.
int addShape(shapeObj shape)
Appends a shape to an open shapefile.
int addPoint(pointObj point)
Appends a point to an open shapefile.
void free()
Closes a shape file (and commits all changes in write mode) and
releases all resources used by the object.
4.22. ShapeObj Class
Constructor, members, and methods.
• Constant names and class member variable names are case-sensitive in PHP.
• Several MapScript functions (all those that access files in the back end such as ms_newMapObj(),
drawMap(), etc.) will affect the value of the current working directory (CWD) in the PHP
environment. This will be fixed eventually but in the meantime you should be careful about these
side-effects.
Constructor:
ShapeObj ms_newShapeObj(int type)
'type' is one of MS_SHAPE_POINT, MS_SHAPE_LINE, MS_SHAPE_POLYGON or
MS_SHAPE_NULL
ShapeObj ms_shapeObjFromWkt(string wkt)
Creates new shape object from WKT string.
Members:
string text
int classindex
int type (read-only)
int numlines (read-only)
int index
int tileindex (read-only)
rectObj bounds (read-only)
int numvalues (read-only)
array values (read-only)
The values array is an associative array with the attribute values for
this shape. It is set only on shapes obtained from layer->getShape().
The key to the values in the array is the attribute name, e.g.
$population = $shape->values[quot;Populationquot;];
Methods:
int set(string property_name, new_value)
Set object property to a new value. Returns -1 on error.
int add(lineObj line)
Add a line (i.e. a part) to the shape.
30/36
31. LineObj line(int i)
Returns a reference to line number i. Reference is valid only
during the life of the shapeObj that contains the point.
int draw(mapObj map, layerObj layer, imageObj img)
Draws the individual shape using layer.
Returns MS_SUCCESS/MS_FAILURE.
boolean contains(pointObj point)
Returns MS_TRUE if the point is inside the shape, MS_FALSE otherwise.
boolean intersects(shapeObj shape)
Returns MS_TRUE if the two shapes intersect, MS_FALSE otherwise.
int project(projectionObj in, projectionObj out)
Project the shape from quot;inquot; projection (1st argument) to quot;outquot;
projection (2nd argument). Returns MS_SUCCESS/MS_FAILURE.
pointObj getpointusingmeasure(double m)
Apply only on Measured shape files. Given a measure m, retun the
corresponding XY location on the shapeobject.
pointObj getmeasureusingpoint(pointObject point)
Apply only on Measured shape files. Given an XY Location, find the
nearest point on the shape object. Return a point object
of this point with the m value set.
void free()
Destroys resources used by a shape object.
string getvalue(layerObj layer, string filedname)
Returns the value for a given field name.
shapeobj buffer(width)
Returns a new buffered shapeObj based on the supplied distance (given
in the coordinates of the existing shapeObj).
Only available if php/mapscript is built with GEOS library.
shapeobj convexhull()
Returns a shape object representing the convex hull of shape.
Only available if php/mapscript is built with GEOS
library.
shapeobj boundary()
Returns the boundary of the shape.
Only available if php/mapscript is built with GEOS library.
int containsShape(shapeobj shape2)
Returns true if shape2 passed as argument is entirely within the shape.
Else return false.
Only available if php/mapscript is built with GEOS
library.
shapeobj union(shapeobj shape)
Returns a shape object representing the union of the shape object
with the one passed as parameter.
Only available if php/mapscript is built with GEOS
library
shapeobj union_geos(shapeobj shape) : (Deprecated in v5.2. Use union instead)
Returns a shape object representing the union of the shape object
with the one passed as parameter.
Only available if php/mapscript is built with GEOS
31/36
32. library.
shapeobj intersection(shapeobj shape)
Returns a shape object representing the intersection of the shape
object with the one passed as parameter.
Only available if php/mapscript is built with GEOS library.
shapeobj difference(shapeobj shape)
Returns a shape object representing the difference of the
shape object with the one passed as parameter.
Only available if php/mapscript is built with GEOS library.
shapeobj symdifference(shapeobj shape)
Returns the computed symmetric difference of the supplied and existing
shape.
Only available if php/mapscript is built with GEOS library.
int overlaps(shapeobj shape)
Returns true if the shape passed as argument overlaps the shape.
Else returns false.
Only available if php/mapscript is built with GEOS library.
int within(shapeobj shape2)
Returns true if the shape is entirely within the shape2 passed as argument.
Else returns false.
Only available if php/mapscript is built with GEOS library.
int crosses(shapeobj shape)
Returns true if the shape passed as argument crosses the shape.
Else return false.
Only available if php/mapscript is built with GEOS library.
int touches(shapeobj shape)
Returns true if the shape passed as argument touches the shape.
Else return false.
Only available if php/mapscript is built with GEOS library.
int equals(shapeobj shape)
Returns true if the shape passed as argument is equal to the
shape (geometry only). Else return false.
Only available if php/mapscript is built with GEOS library.
int disjoint(shapeobj shape)
Returns true if the shape passed as argument is disjoint to the
shape. Else return false.
Only available if php/mapscript is built with GEOS library.
pointObj getCentroid()
Returns a point object representing the centroid of the shape.
Only available if php/mapscript is built with GEOS library.
double getArea()
Returns the area of the shape (if applicable).
Only available if php/mapscript is built with GEOS library.
double getLength()
Returns the length (or perimeter) of the shape.
Only available if php/mapscript is built with GEOS library.
pointObj getLabelPoint()
Returns a point object with coordinates suitable for labelling
the shape.
string toWkt()
32/36
33. Returns WKT representation of the shape's geometry.
int setBounds()
Updates the bounds property of the shape.
Must be called to calculate new bounding box after new parts have been
added. Returns true if successful. Else return false.
4.23. StyleObj Class
Constructor, members, and methods.
• Constant names and class member variable names are case-sensitive in PHP.
• Several MapScript functions (all those that access files in the back end such as ms_newMapObj(),
drawMap(), etc.) will affect the value of the current working directory (CWD) in the PHP
environment. This will be fixed eventually but in the meantime you should be careful about these
side-effects.
Constructor:
Instances of styleObj are always embedded inside the classObj.
styleObj ms_newStyleObj(classObj class [, styleObj style])
The second argument 'style' is optional. If given, the new style
created will be a copy of the style passed as argument.
Members:
int symbol
string symbolname
int size
int minsize
int maxsize
int offsetx
int offsety
int antialias
colorObj color
colorObj backgroundcolor
colorObj outlinecolor
int width
int minwidth
int maxwidth
double angle
string angleitem
string sizeitem
double minvalue
double maxvalue
string rangeitem
int opacity (this parameter is only supported for the AGG driver)
Methods:
int set(string property_name, new_value)
Set object property to a new value. Returns -1 on error.
styleObj clone()
Returns a cloned copy of the style.
int setBinding(const stylebinding, string value)
Set the attribute binding for a specfiled style property. Returns true on success.
33/36
34. Added in MapServer 5.0.
Example:
$oStyle->setbinding(MS_STYLE_BINDING_COLOR, quot;FIELD_NAME_COLORquot;);
This would bind the color parameter with the data (ie will extract
the value of the color from the field called quot;FIELD_NAME_COLORquot;
int removeBinding(const stylebinding)
Remove the attribute binding for a specfiled style property. Returns true on success.
Added in MapServer 5.0.
Example:
$oStyle->removebinding(MS_STYLE_BINDING_COLOR);
4.24. SymbolObj
Constructor, members, and methods.
• Constant names and class member variable names are case-sensitive in PHP.
• Several MapScript functions (all those that access files in the back end such as ms_newMapObj(),
drawMap(), etc.) will affect the value of the current working directory (CWD) in the PHP
environment. This will be fixed eventually but in the meantime you should be careful about these
side-effects.
Constructor:
symboldid = ms_newSymbolObj(mapObj map, string symbolname);
Creates a new symbol with default values in the symbolist.
Returns the Id of the new symbol. If a symbol with the same
name exists, It's id will be returned.
To get a symbol object, you need to use a method on the map object:
$oSymbol = $map->getSymbolObjectById($nId);
Members:
string name;
type name; //Please refer to symbol type constants
int inmapfile; If set to TRUE, the symbol will be saved inside
the mapfile.
double sizex;
double sizey
int numpoints (Read-Only)
int filled;
int patternlength; (Read-Only)
int stylelength; (Deprecated in v5.0, use patternlength instead.) (Read-Only)
string imagepath; (Read-Only))
int transparent;
int transparentcolor;
string character;
int antialias;
string font;
int gap;
int position;
Methods:
int set(string property_name, new_value)
Set object property to a new value.
34/36
35. int setpoints(array double)
Set the points of the symbol. Note that the values passed if an
array containing the x and y values of the points. Example
array[0] = 1 : x value of the first point
array[1] = 0 : y values of the first point
array[2] = 1 : x value of the 2nd point
....
int setpattern(array int)
Set the pattern of the symbol (used for dash patterns)
array getpointsarray()
Returns an array containing the points of the symbol. Refer
to setpoints to see how the array should be interpreted.
array getpatternarray()
Returns an array containing the pattern.
int setimagepath(char filename)
Loads a pixmap symbol specified by the filename.
The file should be of either Gif or Png format.
int setstyle(array int)
Deprecated in v5.0, will be removed in a future release.
Use setpattern() instead.
array getstylearray()
Deprecated in v5.0, will be removed in a future release.
Use getpatternarray() instead.
Example of usage:
1- crete a symbol to be used as a dash line
$nId = ms_newsymbolobj($gpoMap, quot;mydashquot;);
$oSymbol = $gpoMap->getsymbolobjectbyid($nId);
$oSymbol->set(quot;filledquot;, MS_TRUE);
$oSymbol->set(quot;sizexquot;, 1);
$oSymbol->set(quot;sizeyquot;, 1);
$oSymbol->set(quot;inmapfilequot;, MS_TRUE);
$aPoints[0] = 1;
$aPoints[1] = 1;
$oSymbol->setpoints($aPoints);
$aPattern[0] = 10;
$aPattern[1] = 5;
$aPattern[2] = 5;
$aPattern[3] = 10;
$oSymbol->setpattern($aPattern);
$style->set(quot;symbolnamequot;, quot;mydashquot;);
2- Create a TrueType symbol
$nId = ms_newSymbolObj($gpoMap, quot;ttfSymbolquot;);
$oSymbol = $gpoMap->getSymbolObjectById($nId);
$oSymbol->set(quot;typequot;, MS_SYMBOL_TRUETYPE);
$oSymbol->set(quot;filledquot;, true);
$oSymbol->set(quot;characterquot;, quot;Dquot;);
$oSymbol->set(quot;fontquot;, quot;ttfFontNamequot;);
35/36
36. 4.25. WebObj Class
Constructor, members, and methods.
• Constant names and class member variable names are case-sensitive in PHP.
• Several MapScript functions (all those that access files in the back end such as ms_newMapObj(),
drawMap(), etc.) will affect the value of the current working directory (CWD) in the PHP
environment. This will be fixed eventually but in the meantime you should be careful about these
side-effects.
Constructor:
Instances of webObjare always are always embedded inside the mapObj.
Members:
string log;
string imagepath
string template
string imageurl
string header
string footer
string empty (read-only)
string error (read-only)
string mintemplate
string maxtemplate
double minscaledenom
double maxscaledenom
double minscale (Deprecated in v5.0, use minscaledenom instead)
double maxscale (Deprecated in v5.0, use maxscaledenom instead)
rectObj extent (read-only)
string queryformat
string legendformat
string browseformat
Methods:
int set(string property_name, new_value)
Set object property to a new value. Returns -1 on error.
36/36