nevadskiy / laravel-geonames Goto Github PK
View Code? Open in Web Editor NEW🌎 Populate your database using the GeoNames service.
License: MIT License
🌎 Populate your database using the GeoNames service.
License: MIT License
Hey @nevadskiy - thanks for your work on this package. I'm going through the code and it doesn't look like it supports Postal Codes importing (https://download.geonames.org/export/zip/).
Do you plan on supporting this as well? I may try and take a stab at importing the Postal Codes from Geonames as well with a PR.
При запуске команды
php artisan geonames:insert --reset
Решение временно отключаем проверку ключей
в файле InsertCommand добавить
public function handle() {
Schema::disableForeignKeyConstraints();
.....
Schema::enableForeignKeyConstraints();
}
при добавлении России в таблице countries поле area(double(10, 2)) не достаточно, не помещается значение
увеличить поле area(double(12, 2))
Hi there,
I'm using your fantastic package and would like to ask you for adding (or pointing out if there is already some possible solution without changing the package) more Geonames Feature codes. Currently the package supports codes like these:
However, I need also support for other codes like:
More listed here: http://www.geonames.org/export/codes.html ↗
I have tried to extend CitySeeder (adding new codes into array $featureCodes), but it does not seem work even with updated filter method.
My code from /database/seeders/Geo/CitySeeder.php:
<?php
namespace Database\Seeders\Geo;
use App\Models\Geo\City;
use Illuminate\Database\Eloquent\Model;
use Nevadskiy\Geonames\Seeders\CitySeeder as Seeder;
class CitySeeder extends Seeder
{
protected static $model = City::class;
protected $minPopulation = 5000;
/**
* The allowed feature codes.
*
* @var array
*/
protected $featureCodes = [
FeatureCode::PPL,
FeatureCode::PPLC,
FeatureCode::PPLA,
FeatureCode::PPLA2,
FeatureCode::PPLA3,
FeatureCode::PPLS,
FeatureCode::MT,
FeatureCode::HLL,
];
/**
* Get a new country model instance.
*/
protected function newCountryModel(): Model
{
return CountrySeeder::newModel();
}
/**
* Get a new division model instance.
*/
protected function newDivisionModel(): Model
{
return DivisionSeeder::newModel();
}
protected function filter(array $record): bool
{
// Change filter to accept also hills and mountains
if (
// cities above given minPopulation
(
in_array($record['feature code'], $this->featureCodes, true)
&&
strpos($record['feature code'], 'PPL') !== false
&&
$record['population'] >= $this->minPopulation
)
||
// or mountains and hills - minPopulation is irelevant
in_array($record['feature code'], ['MT', 'HLL'])
) {
return true;
} else {
return false;
}
}
}
Adding support for more Feature codes would make this package even more useful and flexible.
Thank you for creating and maintaining this great package.
Wishes,
Pavel
В странах столица хранится в бд в виде строки, может было бы правильнее и удобнее хранить ее в виде связи с объектом города?
Hi there, thank you for the work on this package first of all.
It was smooth sailing when I was developing with this package locally. Everything seems to work great there.
When I pushed my code to a testing environment however, I'm getting the following error after running geonames;seed:
In Container.php line 1126:
Target [Symfony\Component\Console\Input\InputInterface] is not instantiable
while building [Nevadskiy\Geonames\Console\GeonamesSeedCommand, Database\S
eeders\Geo\ContinentSeeder, Nevadskiy\Geonames\GeonamesSource, Nevadskiy\Ge
onames\GeonamesDownloader, Illuminate\Console\OutputStyle].
FYI: I have overrided the default seeders by publishing the package seeders, though I've only changed the $minPopulation variable.
Tried manually adding the InputInterface to my serviceprovider but that didn't help at all.
Hello there!
How are you? Are you safe?
Tried seeding and keep getting error above. Changed the model etc to be bigint and still giving issues.
"SQLSTATE[22003]: Numeric value out of range: 1264 Out of range value for column 'elevation' at row 521"
Seems this entry, 5 column is elevation is stopping the insert, which is confusing since 1868 isn't bug
(130, 2022-08-31 19:08:21, 1868, 1745, 1868, PPL, 1232783, 6.97078, 80.78286, Nuwara Eliya, 27500, Asia/Colombo, 2022-01-10 00:00:00)
and then row 521 is
(119, 2022-08-31 19:08:16, -9999, 1619, ?, PPL, 1091117, -12.15667, 44.40806, Mirontsi, 10168, Indian/Comoro, 2020-06-14 00:00:00),
Class 'Laravel\Nova\Nova' not found
Trait "Nevadskiy\Translatable\Strategies\ExtraTableExtended\HasTranslations" not found
at vendor/nevadskiy/laravel-geonames/src/Translations/HasTranslations.php:11
Translateable package is required when installing laravel-geonames. Great job on the package, btw!
Laravel 11.x Support
Сейчас на всех объектах timezone указан строковым идентификатором (Europe\Moscow).
Я считаю что правильнее было бы собрать все timezones в отдельную таблицу и создать связи со всеми объектами по внутреннему ID.
Как считаешь?
Hello, I hope u r doing well,
Trying to install on Laravel 9.1,
composer require nevadskiy/laravel-geonames
I am getting the following error:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- nevadskiy/downloader 0.3.0 requires psr/log ^1.1 -> found psr/log[1.1.0, ..., 1.1.4] but the package is fixed to 3.0.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
- nevadskiy/laravel-geonames 0.4.2 requires nevadskiy/downloader 0.3.0 -> satisfiable by nevadskiy/downloader[0.3.0].
- Root composer.json requires nevadskiy/laravel-geonames ^0.4.2 -> satisfiable by nevadskiy/laravel-geonames[0.4.2].
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
You can also try re-running composer require with an explicit version constraint, e.g. "composer require nevadskiy/laravel-geonames:*" to figure out if any version is installable, or "composer require nevadskiy/laravel-geonames:^2.1" if you know which you need.
Hello @nevadskiy thank you for making this! Is it possible to get an update so the package will install with php 8.1 and above and Laravel 10? Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.