From coupet:

further observation:

Import as per field values on a per record basis.

Enable the Location module
Enable the Locative information for cck content type in administer » settings » content types

created a cvs file that include location information:
Location Name, Street, Additional Address, City, State or Province, Zip or Postal Code, Country, Latitude, Longitude

Unable to import State or province, Country
Successfully imported Location Name, Street, Additional address, City, Zip or Postal Code

Note: Location module is distributed with State or Province table and Country table
#9 submitted by coupet on May 17, 2006 - 18:40

unable to import States or Province codes.

as per supported location include files, the field value for States or Provinces can have the following values:
LIV, LND, LUT, MAN, MDW (examples for UK Provinces)
NY, CT, AL, NJ, DC (examples for US States)

The country code import works nicely.
uk, us (examples for United Kingdom and United States)

References
'LIV' => "Liverpool", 'LND' => "London City of", 'LUT' => "Luton", 'MAN' => "Manchester", 'MDW' => Medway"
'NY' => "New York", 'CT' => "Connecticut",

CommentFileSizeAuthor
#5 import_location_1.inc1.96 KBdado

Comments

dado’s picture

I cannot reproduce this error. Could you clarify what is the current state of the problem (apologies I am slightly confused by conflicting statements above).
Thanks

coupet’s picture

update: Unable to import State or Province, successfully imported all other fields.

Robrecht Jacques’s picture

If you set country to something like "be", "us", "uk" => country is imported.
You need to set state/province to something like "us-CA", "uk-LIV", not just "CA" or "LIV".

I will check whether there is an easy way for node_import to know this. Maybe even allow things like "California" and "Liverpool" or at least be case-insensitive. Need to check location.module a bit more.

Does importing work if you us "us-CA" ?

coupet’s picture

it works perfectly as advised. thanks

dado’s picture

StatusFileSize
new1.96 KB

Robrecht,
I attach a slightly revised version of import_location.inc
This version populates the country field with the value selected for that record. If no country value was specified, it populates the country field with the user's default country. Please let me know what you think
dado

dado’s picture

I should have said:
If no country value was specified, it populates the country field with the site's default country.

coupet’s picture

It works nicely, but for the province, the field value was uk-LIV, and it inserted United States as default value.
suggest having a seperate section to include default global value for country similar to taxonomy.

coupet’s picture

excellent, should be perfect, suggest advise the user in the wizard of Location country default value.

Home » administer » settings » location
Default country selection:

Robrecht Jacques’s picture

Dado's patch committed.

I'll check later how to do this country and province/state correctly, but I need to read some things about location module first.

Robrecht Jacques’s picture

Fixed in CVS: you can now enter the name of the country (Belgium) or the country iso code (be). The same is true for province/state: either enter the name (New York), the full code (us-NY) or the abbreviated code if the country is set (NY).

Robrecht Jacques’s picture

Status: Active » Fixed

So "fixed".

Anonymous’s picture

Status: Fixed » Closed (fixed)