Giter Site home page Giter Site logo

geo's Introduction

DataValues

Small PHP library that provides interfaces for Value Objects. Several libraries build on top of this foundation.

GitHub Workflow Status codecov

On Packagist: Latest Stable Version Download count

Installation

To add this package as a local, per-project dependency to your project, simply add a dependency on data-values/data-values to your project's composer.json file. Here is a minimal example of a composer.json file that just defines a dependency on DataValues 3.x:

    {
        "require": {
            "data-values/data-values": "^3.1.0"
        }
    }

Running the tests

For tests only

composer test

For style checks only

composer cs

For a full CI run

composer ci

Authors

DataValues has been written primarily by Jeroen De Dauw, in part for the Wikidata project and Wikimedia Germany.

Contributions where also made by several other awesome people.

Release notes

3.1.0 (2022-10-21)

  • Improved compatibility with PHP 8.1; in particular, the new __serialize/__unserialize methods are implemented now (in addition to the still supported Serializable interface). Care has been taken to keep the output of getHash() stable; if other classes include the PHP serialization of data values in their own hashes, they should instead use the new getSerializationForHash() method where it exists.

3.0.0 (2021-01-19)

  • Removed getCopy from the DataValue interface and all implementations
  • Removed getSortKey from the DataValue interface and all implementations
  • Removed the Comparable, Hashable and Immutable interfaces
  • Removed DATAVALUES_VERSION constant
  • Removed DataValueTest (create a copy if you need it, though better refactor away the bad design)
  • Raised minimum PHP version from 5.5.9 to 7.2

2.3.0 (2019-09-16)

  • composer.json and phpunit.xml.dist are now included in releases

2.2.1 (2019-09-05)

  • Fixed DataValueTest not being part of the release

2.2.0 (2019-09-05)

  • Deprecated DATAVALUES_VERSION constant

2.1.1 (2017-09-28)

  • Fixed DataValueTest not being installable via Composer

2.1.0 (2017-08-09)

  • Removed MediaWiki integration

2.0.0 (2017-08-02)

  • Dropped Copyable interface
  • Dropped deprecated constant DataValues_VERSION, use DATAVALUES_VERSION instead
  • Deprecated newFromArray in all DataValue implementations.
  • Updated minimal required PHP version from 5.3 to 5.5.9
  • Updated documentation throughout the code

1.1.1 (2017-11-02)

  • Add .gitattributes file

1.1.0 (2017-08-09)

  • Remove MediaWiki integration

1.0.0 (2014-09-26)

  • The CI now ensures compatibility with PHP 5.6 and HHVM
  • A lot of type hints where improved
  • Protected methods and fields where changed to private
  • The test bootstrap no longer executes composer update
  • The test bootstrap now sets PHP strict mode
  • The contract of the Hashable::getHash method was updated
  • The MediaWiki internationalization support has been migrated to the JSON based version

0.1.1 (2013-11-22)

  • Removed support for running the tests via the MediaWiki test runner.
  • The test bootstrapping file now automatically does a composer install.
  • Removed custom autoloader in favour of defining autoloading in composer.json.

0.1.0 (2013-11-16)

Initial release with these features:

  • DataValue interface
    • BooleanValue implementation
    • NumberValue implementation
    • StringValue implementation
    • UnDeserializableValue implementation
    • UnknownValue implementation
  • Common interface definitions: Comparable, Copyable, Hashable, Immutable

Links

geo's People

Contributors

0x686578 avatar addshore avatar adrianheine avatar bekh6ex avatar dependabot[bot] avatar filbertkm avatar frimelle avatar gmelikov avatar jakobw avatar janzerebecki avatar jeroendedauw avatar jonaskress avatar ladsgroup avatar legoktm avatar lucaswerkmeister avatar manicki avatar mariushoch avatar reedy avatar reiz avatar rosalieper avatar silvan-wmde avatar thiemowmde avatar tobijat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

geo's Issues

Possible to release 4.2.3 version?

Thanks for speeding up the release of 4.3.0. When trying to update the version in mediawiki-vendor, I've realized our PHP version is 7.2 and doesn't meet the requirements for version 4.3.0 of DataValues/Geo package.

Is it possible to make a release 4.2.3 that only includes PR 200 and doesn't update the version? Thank you.

Altitude support

Posted by Van de Bugger on 2011-11-28 23:04:08 UTC at https://bugzilla.wikimedia.org/show_bug.cgi?id=32698

It would be nice to add the third coordinate to `Geographic coordinate' data type to represent altitude. Currently latitude and longitude are separated either with comma or semicolon. The third component could be treated as altitude, e. g.:

45° 1′ N, 55° 30′ E, 1000 m

or

25° 56′ N, 45° 32′ E, -100 ft

High coordinate precision fires "The value does not comply with the property's definition."

Posted by Ivan A. Krestinin on 2013-10-21 18:10:32 UTC at https://bugzilla.wikimedia.org/show_bug.cgi?id=55971

https://www.wikidata.org/w/index.php?title=Q252530&oldid=80289969 ()
fires error "The value does not comply with the property's definition.
The value's data value type "ununserializable" does not match the property's data type's data value type "globecoordinate"."

But
https://www.wikidata.org/w/index.php?title=Q252530&oldid=80289969 ()
works fine.

As I remember previous software version handle fine both versions.

`InvalidArgumentException` from line 69 of "LatLongValue.php"

Setup

  • MediaWiki 1.28.0 (fec3e69) 18:52, 1 March 2017
  • PHP 5.6.30-0+deb8u1 (apache2handler)
  • MariaDB 10.0.30-MariaDB-1~jessie
  • Semantic MediaWiki 2.5.0 (73c1844) 08:19, 13 March 2017
  • Maps 4.0.5 (2a751f5) 09:00, 6 March 2017
  • data-values/geo 1.2.1

Issue
[925cecf32043ae73a6bac3f4] /wiki/Berlin InvalidArgumentException from line 69 of /.../w/vendor/data-values/geo/src/Values/LatLongValue.php: Can only construct LatLongValue with a numeric latitude

Backtrace

#0 /.../w/vendor/data-values/geo/src/Values/LatLongValue.php(57): DataValues\Geo\Values\LatLongValue->assertIsLatitude(NULL)
#1 /.../w/extensions/Maps/SemanticMaps/src/SM_GeoCoordsValue.php(66): DataValues\Geo\Values\LatLongValue->__construct(NULL, NULL)
#2 /.../w/extensions/Maps/SemanticMaps/src/SM_GeoCoordsValue.php(34): SMGeoCoordsValue->getFormattedCoord(SMWDIGeoCoord)
#3 /.../w/extensions/SemanticMediaWiki/includes/datavalues/SMW_DataValue.php(217): SMGeoCoordsValue->loadDataItem(SMWDIGeoCoord)
#4 /.../w/extensions/SemanticMediaWiki/src/DataValueFactory.php(171): SMWDataValue->setDataItem(SMWDIGeoCoord)
#5 /.../w/extensions/SemanticMediaWiki/src/Factbox/Factbox.php(374): SMW\DataValueFactory->newDataValueByItem(SMWDIGeoCoord, SMW\DIProperty)
#6 /.../w/extensions/SemanticMediaWiki/src/Factbox/Factbox.php(288): SMW\Factbox\Factbox->getTableContent(SMW\SemanticData)
#7 /.../w/extensions/SemanticMediaWiki/src/Factbox/Factbox.php(238): SMW\Factbox\Factbox->createTable(SMW\SemanticData)
#8 /.../w/extensions/SemanticMediaWiki/src/Factbox/Factbox.php(112): SMW\Factbox\Factbox->fetchContent(integer)
#9 /.../w/extensions/SemanticMediaWiki/src/Factbox/CachedFactbox.php(236): SMW\Factbox\Factbox->doBuild()
#10 /.../w/extensions/SemanticMediaWiki/src/Factbox/CachedFactbox.php(146): SMW\Factbox\CachedFactbox->rebuild(Title, ParserOutput, RequestContext)
#11 /.../w/extensions/SemanticMediaWiki/src/MediaWiki/Hooks/OutputPageParserOutput.php(85): SMW\Factbox\CachedFactbox->prepareFactboxContent(OutputPage, ParserOutput)
#12 /.../w/extensions/SemanticMediaWiki/src/MediaWiki/Hooks/OutputPageParserOutput.php(58): SMW\MediaWiki\Hooks\OutputPageParserOutput->performUpdate()
#13 /.../w/extensions/SemanticMediaWiki/src/MediaWiki/Hooks/HookRegistry.php(194): SMW\MediaWiki\Hooks\OutputPageParserOutput->process()
#14 [internal function]: SMW\MediaWiki\Hooks\HookRegistry->SMW\MediaWiki\Hooks\{closure}(OutputPage, ParserOutput)
#15 /.../w/includes/Hooks.php(195): call_user_func_array(Closure, array)
#16 /.../w/includes/OutputPage.php(1785): Hooks::run(string, array)
#17 /.../w/includes/OutputPage.php(1823): OutputPage->addParserOutputMetadata(ParserOutput)
#18 /.../w/includes/page/Article.php(589): OutputPage->addParserOutput(ParserOutput)
#19 /.../w/includes/actions/ViewAction.php(71): Article->view()
#20 /.../w/includes/MediaWiki.php(495): ViewAction->show()
#21 /.../w/includes/MediaWiki.php(289): MediaWiki->performAction(Article, Title)
#22 /.../w/includes/MediaWiki.php(851): MediaWiki->performRequest()
#23 /.../w/includes/MediaWiki.php(512): MediaWiki->main()
#24 /.../w/index.php(43): MediaWiki->run()
#25 {main}

Example

@JeroenDeDauw Looks like our first SMW 2.5.0 collateral

Fix PHP 8.1 deprecation warnings

Using PHP 8.1.6
PHP Deprecated: DataValues\Geo\Values\LatLongValue implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in /home/runner/work/Maps/Maps/mediawiki/vendor/data-values/geo/src/Values/LatLongValue.php on line 22

Latitude +/- 360?

In file called LatLongValue.php the latitude is defined in the range [-360, 360].
This can lead to an error.
Using degrees, the latitude must be in the range [-90, 90], conventionally from South Pole (-90), Equator (0), to North Pole (90).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.